How to run a batch file each time the computer loads Windows

Updated: 04/02/2019 by Computer Hope
Batch file

You may need to run a batch file to configure devices, delete or copy files, or perform other tasks each time the computer loads to help it run more efficiently or allow a device to run. Below are steps on how to make any batch file run each time you boot into Windows.

Note

If there are two or more user accounts on the computer, the batch file will be run after a user account is selected and that user logs in to Windows.

Run a batch file at loading of Windows 8 and 10

  1. Create a shortcut to the batch file.
  2. Once the shortcut is created, right-click the shortcut file and select Cut.
  3. Press Start, type Run, and press Enter.
  4. In the Run window, type shell:startup to open the Startup folder.
  5. Once the Startup folder is opened, click the Home tab at the top of the folder and select Paste to paste the shortcut file into the Startup folder.

Run a batch file at loading of Windows 98, XP, NT, 2000, Vista, and 7

  1. Create a shortcut to the batch file.
  2. Once the shortcut is created, right-click the shortcut file and select Cut.
  3. Click Start, then Programs or All Programs. Find the Startup folder and right-click that folder, then select Open.
  4. Once the Startup folder is opened, click Edit in the menu bar, then Paste to paste the shortcut file into the Startup folder. If you do not see the menu bar, press the Alt key to make the menu bar visible.

Any shortcuts in the Startup folder will automatically run each time the user logs in to Windows.

Run a batch file at loading of Windows 95, 3.x, and MS-DOS

The autoexec.bat file is in the root directory of the C: drive (C:\autoexec.bat). Place a line in your autoexec.bat that calls the batch file each time you want to boot the computer, as shown below.

CALL C:\myfile.bat

In the example above, each time your computer starts and processes the autoexec.bat file, it runs the batch file myfile.bat.

Note

The autoexec.bat is only available with early versions of Windows and is not available or used in any version of Windows after Windows XP.

Additional information