How to Run a BAT File on Windows

This wikiHow teaches you how to run a BAT file—also known as a batch file—on a Windows computer. Batch files have many purposes, such as automating frequently used tasks. You can run them in the normal File Explorer, or you can launch them ...

Method 1 of 2:

Running in File Explorer

  1. Picture 1 of How to Run a BAT File on Windows
    Open Start
    Picture 2 of How to Run a BAT File on Windows
    . Click the Windows logo in the bottom-left of the taskbar to launch the start menu.
  2. Picture 3 of How to Run a BAT File on Windows
    Click
    Picture 4 of How to Run a BAT File on Windows
    File Explorer. It's in the left-side column of the start menu.
    1. You can also right-click on the Windows icon in the task bar and select File Explorer.
    EXPERT TIP
    Picture 5 of How to Run a BAT File on Windows

    wikiHow

    Staff
    A wikiHow Staff Editor reviewed and edited this article to make sure that it is comprehensive, helpful, and accurate. Our team of experienced and carefully-trained writers and editors improves articles using quality research sources, and academic and personal experience.
    Picture 6 of How to Run a BAT File on Windows
    wikiHow
    Staff

    If you don't see the File Explorer option, right click on Settings.
    Select the folders you want to appear on the Start menu. In this case, select the File Explorer.
    You can also select Videos, Music, Downloads etc.

  3. Picture 7 of How to Run a BAT File on Windows
    Go to the folder that contains your BAT file. Navigate to the location of your batch file or you can search for by clicking This PC in the left pane and typing the filename in the search bar at the top-right.
  4. Picture 8 of How to Run a BAT File on Windows
    Double-click the BAT file. Normally, to run a batch file, all that is needed is to double-click the file. If you are experiencing problems running the file successfully you can try running it as an administrator.
  5. Picture 9 of How to Run a BAT File on Windows
    Right-click the file and select Run as administrator. Depending on what the batch file is programmed to do, running it with administrator privileges may be required.
    1. Oftentimes, batch files don't do much visually on your computer, and running them will make changes to your computer behind the scenes. Be sure you understand what your batch file is supposed to do, as it may have run successfully even though it didn't look like anything happened.
Method 2 of 2:

Running in Command Prompt

  1. Picture 10 of How to Run a BAT File on Windows
    Open Start
    Picture 11 of How to Run a BAT File on Windows
    . Click the Windows logo in the bottom-left of the taskbar to launch the start menu.
  2. Picture 12 of How to Run a BAT File on Windows
    Type cmd into start. As you type, Windows will filter search results below your text in the Start Menu.
  3. Picture 13 of How to Run a BAT File on Windows
    Right-click on Command Prompt
    Picture 14 of How to Run a BAT File on Windows
    . It's the black icon with the white text in the upper-left corner.
  4. Picture 15 of How to Run a BAT File on Windows
    Click Run as administrator. Running command prompt with administrator privileges might be required depending on what your batch file is programmed to do.
  5. Picture 16 of How to Run a BAT File on Windows
    Type cd followed by the file's location. Type the letters "cd", which is the command to "change directory"—and then type a space—followed by the folder location the batch file is in. For example, if your batch file is located on the desktop of the username "Jeff", you would type:
    cd /Users/Jeff/Desktop.
    1. Don't forget a space between "cd" and the file's location.
  6. Picture 17 of How to Run a BAT File on Windows
    Press Enter. This changes the current directory to the new location you specified.
  7. Picture 18 of How to Run a BAT File on Windows
    Type the BAT file's full filename. That means typing the filename and extension, ending with .bat at the end. For example, if your batch file is named "install", then you would type install.bat into the command prompt.
  8. Picture 19 of How to Run a BAT File on Windows
    Press Enter. This will run the BAT file. If you see the same command prompt location as before and the cursor is blinking, the batch file has finished running.
    1. Note any errors that appear in the command prompt from running the batch file, as that may be helpful in troubleshooting something wrong the batch file's code.
Update 04 March 2020
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile