By David Wiseman (Administrator)published 06 Feb 2008, modified 02 Mar 2009
My Rating:
Not Rated

Batch File (MS-DOS Batch File) Introduction

What are Batch Files?

Batch Files are a collection of command-line instructions "batched" together.  Batch files are still very popular among system administrators as a tool to help automate administrative tasks.

How do I create a Batch File?

Batch files are text files saved with a "*.BAT" file extension.  This means that you can create batch files using Notepad.  When you save a batch file in notepad be sure to enclose the name in double quotes. e.g. "MyScript.bat".  The double quotes will ensure that the file gets saved with the right extension (instead of MyScript.bat.txt).

Although you can use notepad to create batch files, programs like NotePad++ can make it easier to create batch files.  NotePad++ can highlight syntax and displays the line number, both of which can be useful when creating batch files.

How do I run a Batch File?

You can simply double-click a *.bat file to run it.  You might also want to run a batch file by calling it from a command prompt.

Further Information

The following site contains some good information to get you started: 

Find a Batch File Script