How to Run a Batch File from the Command Line on Windows

Method 1 of 2:

Using Run

  1. How to Run a Batch File from the Command Line on Windows Picture 1
    Press Win+R. This opens the Run dialog.
    1. If you need to run the batch file as an administrator, see this method instead.
  2. How to Run a Batch File from the Command Line on Windows Picture 2
    Click Browse….
  3. How to Run a Batch File from the Command Line on Windows Picture 3
    Navigate to the folder that contains the batch file.
  4. How to Run a Batch File from the Command Line on Windows Picture 4
    Click the batch file once to select it. The file is now highlighted.
  5. How to Run a Batch File from the Command Line on Windows Picture 5
    Click Open. This pastes the full path to the batch file into the Run box.
  6. How to Run a Batch File from the Command Line on Windows Picture 6
    Click OK. The batch file will open in a terminal window and run. When it's finished running, you'll see a line at the bottom of the window that says 'Press any key to continue.'
  7. How to Run a Batch File from the Command Line on Windows Picture 7
    Press any key. This closes the terminal window after the command runs.
Method 2 of 2:

Using a Terminal Window

  1. How to Run a Batch File from the Command Line on Windows Picture 8
    Click the
    How to Run a Batch File from the Command Line on Windows Picture 9
    menu. It's usually at the bottom-left corner of the screen.
  2. How to Run a Batch File from the Command Line on Windows Picture 10
    Type cmd into the search bar. A list of matching results will appear.
  3. How to Run a Batch File from the Command Line on Windows Picture 11
    Right-click Command Prompt. A menu will expand.
  4. How to Run a Batch File from the Command Line on Windows Picture 12
    Click Run as Administrator. A confirmation message will appear.
  5. How to Run a Batch File from the Command Line on Windows Picture 13
    Click Yes. This opens the command line at an elevated (administrator) level.
  6. How to Run a Batch File from the Command Line on Windows Picture 14
    Type cd followed by full path to the folder with the .BAT file. Here's an example:
    1. If the batch file is on your desktop, type cd UsersYourLoginNameDesktop.
    2. If it's in your downloads folder, type cd UsersYourLoginNameDownloads.
    3. If you don't know what your login name is, type cd Users and press Enter to go to the Users folder, and then type dir and press Enter to see a list of logins.
  7. How to Run a Batch File from the Command Line on Windows Picture 15
    Press Enter. This will move you into the directory.
  8. How to Run a Batch File from the Command Line on Windows Picture 16
    Type the name of the batch file. For example, if it's called 'program.bat,' type program.bat.
    1. If you don't know the name, type dir and press Enter to view the files in the folder. You'll find it there.
  9. How to Run a Batch File from the Command Line on Windows Picture 17
    Press Enter. This runs the batch file.
5 ★ | 1 Vote

May be interested

  • Rem command in WindowsRem command in Windows
    the rem command helps write comments (comments) in a batch file or config.sys.
  • 5 software to rename files in batch5 software to rename files in batch
    in everyday life, being able to perform a certain action across an entire series of files or folders will increase labor productivity many times. bulk image editing is a good example of this issue. similarly, there are tools that can help you rename a batch of files at once. such applications will be incorporated in this article. we will introduce you to the best free tools for batch renaming file names in windows.
  • How to Crash Your Computer Using a Batch FileHow to Crash Your Computer Using a Batch File
    for whatever reason, you may want to crash your computer. using your pc's notepad app as a platform, you can create a simple .bat (or 'batch') file that creates an infinite loop of opening command prompt windows; this will rapidly consume...
  • How to batch rename files on Windows without softwareHow to batch rename files on Windows without software
    if you are wondering how to batch rename files on your computer, here are instructions to batch rename files using built-in tools on windows, without using batch file renaming software. invite you to follow along.
  • Manage the Event Log with the command lineManage the Event Log with the command line
    for many of us, using the command line - command line to control and use some of the functions in the windows system will cause them to have headaches and problems. however, if you have to set up an automatic function system in windows and other server operating systems, the command line is an irreplaceable tool ...
  • Call command in WindowsCall command in Windows
    the call command calls a batch program from another program without stopping the original batch program. the call command accepts the label as its target.
  • How to Open a Command Line Program on WindowsHow to Open a Command Line Program on Windows
    tipsmake today will show you how to open the command prompt command line window on windows pc. you can open command prompt from the start menu or any folder in file explorer. besides, the windows run feature is also an option.
  • 5 best command line emulation software for Windows 105 best command line emulation software for Windows 10
    currently, users can get a shell within windows 10, but many still prefer the more configurable command line emulator applications. so this article will introduce you to five of the best command line emulation software for windows 10.
  • Endlocal command in WindowsEndlocal command in Windows
    the endlocal command ends the localization of the environment changes in a batch file, and restores the environment variables to their original values ​​before the corresponding setlocal command is run.
  • Forfiles command in WindowsForfiles command in Windows
    the forfiles command selects and executes a command on a file or set of files. this command is very useful for batch processing.