There are a lot of pretty amazing things that can be done using Batch Files. People use them to automate basic PC processes while others make games. Yes, games! Many though may not even know where to start when it comes to creating Batch Files, but it is quite easy to do.

Steps

  1. 1
    Learn some basic Batch codes. Batch is a script language; it contains numerous codes that cannot be learned in just one setting or one description. There are some basic codes, similar to DOS commands, however, that’s easy to keep in mind:
    • ECHO — Displays text you entered after this code on the screen
    • ECHO OFF — Hides the command output of each command given.
    • REM — Inserts a comment line in the program
    • PAUSE — Temporarily pauses the batch script. Press any key to move to the next command line.
    • EXIT — Exits the Batch script.
  2. 2
    Open the Notepad. Press and hold the Windows key and hit “R” on your keyboard. There will be a little box that pops up in the lower left-hand side of your screen. Type “notepad” and hit Enter. This will open Notepad on the screen.
    • One alternate way to do this is to click the Start menu and type in “notepad” in the search field and hit “Enter” there.
    Advertisement
  3. 3
    Add Batch codes. You cannot create a Batch file without codes, so enter the codes needed for your batch file. Each code being used on each line is a specific command. As an example, you can type or copy all of the following codes, each in a separate line:
    • @Echo Off
    • Echo Hello, World!
    • Pause
    • Exit
    • This code will display the words “Hello, World!” in a small black window when the program is started, and the window will close when any key is pressed.
  4. 4
    Save it correctly. In order for the batch file to run properly, the computer has to know what kind of file it is. That is why it is important that you save it correctly.
    • In the upper left-hand corner, click “File” then “Save As...” A small box will appear.
    • In the pane on the left-hand side of the window, scroll up and select “Desktop,” or wherever you want to saved it.
    • At the bottom of the window under the “Save as type:” field, click and select the “All Files” option. Above it, in the “File name:” field, type in the name of the file but add “.bat” to the end of it (Example.bat).
    • Hit “Save” in the lower right hand corner of the window to save the file.
  5. 5
    Make sure it works. Select the Start Menu and click “Computer.” From this window, navigate to the location of the file that you just saved, and locate the batch file. It should have the name you saved it under, and a little icon with two small gears on it. Double-click to open.
    • If you used the example given in the batch file, a small black window should open with the words “Hello World!” in the upper left-hand corner of it. Tap any key to exit the program. If you created your own batch file to do something else, it should perform what you coded it to do.
    • You have successfully created a batch file on Windows 7.
  6. Advertisement

About This Article

Tested by:
wikiHow Technology Team
wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, volunteer authors worked to edit and improve it over time. This article has been viewed 43,681 times.
How helpful is this?
Co-authors: 3
Updated: August 8, 2017
Views: 43,681
Categories: Windows Files | Windows 7
Advertisement