How to Execute batch file from command line on Windows
Use the Run dialog box
How to Execute batch file from command line on Windows Picture 1
Press ⊞ Win+R . The Run dialog box opens.
If you want to execute the batch file as administrator then check out this method.
How to Execute batch file from command line on Windows Picture 2
Click Browse… (Browse).
How to Execute batch file from command line on Windows Picture 3
Navigate to the folder containing the batch file.
How to Execute batch file from command line on Windows Picture 4
Click on the batch file to select. The file will be highlighted.
How to Execute batch file from command line on Windows Picture 5
Click Open . The full path to the batch file will be pasted into the Run dialog box.
How to Execute batch file from command line on Windows Picture 6
Click OK . The batch file will open in a terminal window and execute. When the file finishes running, a line will appear at the bottom of the window with the content 'Press any key to continue'.
How to Execute batch file from command line on Windows Picture 7
Press any key. The terminal window will close after the command executes.
Use the Terminal window
How to Execute batch file from command line on Windows Picture 8
Click the menu, which is usually located in the lower left corner of the screen.
How to Execute batch file from command line on Windows Picture 9
Type cmdin the search bar. A list of matching results will appear.
How to Execute batch file from command line on Windows Picture 10
Right click on Command Prompt . A menu will appear.
How to Execute batch file from command line on Windows Picture 11
Click Run as Administrator . A confirmation message will appear.
How to Execute batch file from command line on Windows Picture 12
Click Yes . The administrator command line will open.
How to Execute batch file from command line on Windows Picture 13
Enter cdalong with the full path to the folder containing the .BAT file. Here is an example:
If the batch file is on your desktop, type cd UsersYourLoginNameDesktop.
If the file is in the downloads folder, enter cd UsersYourLoginNameDownloads.
If you don't know the login name, type cd Usersand click ↵ Enterto access the Users user folder, then type dirand click ↵ Enterto see the login list.
How to Execute batch file from command line on Windows Picture 14
Press ↵ Enter. You will be redirected to the folder containing the batch file.
How to Execute batch file from command line on Windows Picture 15
Enter the batch file name. For example, if the file is named 'program.bat,' you type program.bat.
If you don't know the file name, enter the command dirand click ↵ Enterto see the files in the folder. You will see the file you are looking for here.
How to Execute batch file from command line on Windows Picture 16
Press ↵ Enter. The batch file will execute.
You should read it
- Instructions for creating and using BAT file on Windows
- 5 software to rename files in batch
- How to Write a Batch File
- How to Run a BAT File on Windows
- How to Launch BAT Files on Windows
- How to batch rename files on Windows without software
- How to Delete a File in Microsoft Windows Using Batch Files
- How to execute .run or .bin packages in Linux
- 5 IF commands help use Batch script smarter
- How to Run a Batch File from the Command Line on Windows
- Top 5 software for fast batch file renaming
- How to Crash Your Computer Using a Batch File