PDF download Download Article PDF download Download Article

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 from the command line of the Command Prompt.

Ways to Run BAT Files on a PC

There are two ways to run BAT files on a PC. Locate your BAT file in the File Explorer, then right-click it and select Run as administrator. In the Command Prompt, type "cd" followed by the BAT's location. Then, type the BAT's filename and press Enter. You likely won't notice much happen after you run a BAT file.

Method 1
Method 1 of 2:

Running in File Explorer

PDF download Download Article
  1. EXPERT TIP
    wikiHow

    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.
    wikiHow
    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.

    Advertisement
  2. 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.
  3. 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.
  4. Depending on what the batch file is programmed to do, running it with administrator privileges may be required.
    • 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.
  5. Advertisement
Method 2
Method 2 of 2:

Running in Command Prompt

PDF download Download Article
  1. As you type, Windows will filter search results below your text in the Start Menu.
  2. Running command prompt with administrator privileges might be required depending on what your batch file is programmed to do.
  3. 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.
    • Don't forget a space between "cd" and the file's location.
  4. This changes the current directory to the new location you specified.
  5. 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.
  6. 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.
    • 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.
  7. Advertisement


Expert Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Video

Tips

Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!

You Might Also Like

Open ISO Files Open an ISO Files on Windows and Mac
Find a File's Path on Windows Find a File's Path on Windows
Open an Img File on PC or MacOpen an Img File on PC or Mac
Make a New File in WindowsEasily Create a New File in Windows: User-Friendly Instructions
Install Msi Files on Windows 10 Install MSI Files on Windows 10 or Windows 11
Rebuild the Icon Cache in WindowsA Guide to Rebuilding the Icon Cache on a Windows PC
Delete Files That Cannot Be DeletedDelete Files That Cannot Be Deleted
Block an Application or .EXE from Running in WindowsBlock an .exe Running in Windows
Install a Screensaver File in WindowsInstall a Screensaver File in Windows
Copy a Folder with Batch FileCopy a Folder with Batch File
Play WebM FilesPlay WebM Files
Locate Temporary Internet Files Locate Temporary Internet Files
Delete a File or Folder Showing Error "Access Is Denied"Delete a File or Folder Showing Error "Access Is Denied"
Delete a File in Microsoft Windows Using Batch FilesDelete a File in Microsoft Windows Using Batch Files
Advertisement

About This Article

Travis Boylls
Written by:
wikiHow Technology Writer
This article was co-authored by wikiHow staff writer, Travis Boylls. Travis Boylls is a Technology Writer and Editor for wikiHow. Travis has experience writing technology-related articles, providing software customer service, and in graphic design. He specializes in Windows, macOS, Android, iOS, and Linux platforms. He studied graphic design at Pikes Peak Community College. This article has been viewed 226,605 times.
How helpful is this?
Co-authors: 6
Updated: August 20, 2024
Views: 226,605
Categories: Windows Files
Thanks to all authors for creating a page that has been read 226,605 times.

Is this article up to date?

Advertisement