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.

Run a batch file at loading of Windows 8 and 10

  • Create a shortcut to the batch file.

  • How to create a Windows shortcut.

  • Once the shortcut is created, right-click the shortcut file and select Cut.

  • Press Start, type Run, and press Enter.

  • In the Run window, type shell:startup to open the Startup folder.

  • Once the Startup folder is opened, click the Home tab at the top of the folder. Then, 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

  • Once the shortcut is created, right-click the shortcut file and select Cut.
  • Click Start, then Programs or All Programs. Find the Startup folder and right-click that folder, then select Open.
  • 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 to make the menu bar visible.

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

If there are two or more user accounts on the computer, the batch file runs after the 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 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.

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.

  • How to make a batch file.
  • How to run a batch file.
  • See our batch file and startup folder for further information and related links.
  • Batch file help.