It's programming time!/Batch/Intro

From Create Your Own Story

Let's Make A Batch File

A batch file is basically just a list of DOS commands. They can be used to automate a repetitive task or run any set of commands you might need on a regular basis. If you follow along you'll soon be able to create your own batch files to make your computing life easier.

You'll need:
*A computer
  • A Windows (or DOS) operating system
  • A text editor (such as notepad)

We'll start with the basics:

  1. Create a new text file. (Right click>>New>>Text Document)
  2. Rename your text file. Change the extension from .txt to .bat
  3. Open your .bat file in your text editor. You can drag and drop it into your editor from Windows.
  4. Add the following text to the file:
@echo The echo command repeats back whatever you type after it.
@pause
  1. Save your file without any formatting (Plain text).
  2. Double click your .bat file to execute the commands.

Remember: Don't edit the batch file while it's running. You can get unexpected errors that way.

Personal tools