How to run a batch file each time the computer boots

Batch fileIt may be necessary to run a batch file to configure computer devices or delete or copy files each time the computer boots to help the computer run more efficiently or allow a device to run.

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.

Windows 8 and 10
Windows 98, XP, NT, 2000, Vista, and 7
Windows 95, 3.x, and MS-DOS

Run a batch file at boot in Windows 8 and 10 users

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

Run a batch file at boot in Windows 98, XP, NT, 2000, Vista, and 7

  1. Create a shortcut to the batch file.
  2. Once the shortcut has been created, right-click the 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 has been opened, click Edit in the menu bar, then Paste to paste the shortcut 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 boot in Windows 95, 3.x, and MS-DOS

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 above example, each time your computer starts and processes the autoexec.bat file, it runs the batch file myfile.bat.

Additional information