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.

5 ★ | 2 Vote

May be interested

  • How to Add and Delete User Accounts with Command Prompt on WindowsPhoto of How to Add and Delete User Accounts with Command Prompt on Windows
    command prompt is basically a version of the 'terminal' application (apple) on windows, a program that allows us to enter system adjustment commands. while most commands users enter into command prompt simply execute the action itself (such as opening a folder), you can also use command prompt to quickly create (or delete) accounts. right on your computer!
  • How to Reset Toshiba LaptopPhoto of How to Reset Toshiba Laptop
    resetting a toshiba laptop (or laptop) is a useful solution in case you want to restore the computer to factory settings and erase all data. although toshiba laptops do not come with recovery discs, you can reset them at any time using the recovery partition on your computer.
  • How to Change Directory in Command PromptPhoto of How to Change Directory in Command Prompt
    this article shows you how to change folders in the command prompt program on a windows computer. to change commands in command prompt, you must use an administrator account.
  • How to Change Your Computer's Date and Time Using Command PromptPhoto of How to Change Your Computer's Date and Time Using Command Prompt
    today's tipsmake will show you how to change the date and time on a computer running windows operating system through the command prompt application. if you don't have administrator access, you won't be able to change the date and time.
  • How to Change or Create Desktop Icons on WindowsPhoto of How to Change or Create Desktop Icons on Windows
    today's wikihow will show you how to change the icons that appear on your windows computer screen. you can change to another icon system, download it, or create your own icons. additionally, you can add your own custom shortcuts to your desktop, change the icons, and even remove the arrow on the shortcut icon.
  • How to Change Startup Program on Windows 7Photo of How to Change Startup Program on Windows 7
    the startup program is saved in a special folder on the hard drive, and runs automatically when windows starts. in windows 7, installing a startup program is similar to previous versions of windows. the article below will show you how to add or disable startup programs.