Click to Rate and Give Feedback
TechNet
TechNet Library
Windows
Windows Server
Windows Server 2003
Scripting Tools
 Using batch files: Scripting; Manag...
Using batch files

Updated: January 21, 2005

Using batch files

With batch files, which are also called batch programs or scripts, you can simplify routine or repetitive tasks. A batch file is an unformatted text file that contains one or more commands and has a .bat or .cmd file name extension. When you type the file name at the command prompt, Cmd.exe runs the commands sequentially as they appear in the file.

You can include any command in a batch file. Certain commands, such as for, goto, and if, enable you to do conditional processing of the commands in the batch file. For example, the if command carries out a command based on the results of a condition. Other commands allow you to control input and output and call other batch files.

The standard error codes that most applications return are 0 if no error occurred and 1 (or higher value) if an error occurred. To determine the meaning of specific error codes, refer to your application help documentation.

For more information about batch file operations, see the following topics:

For more information about commands that you can use in batch files, click a command:

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker