Quincy Center for Technical Education
Computer Technology Department

Batch commands

Select a command to get more information.

call

goto

setlocal

echo

if

shift

endlocal

pause

%

for

rem

 

Batch programs (also called batch files) allow you to simplify routine or repetitive tasks. A batch program is an unformatted text file that contains one or more commands and has a .bat or .cmd file name extension. When the file name is typed at the command prompt, the commands in the file are executed sequentially.

Any command can be included in a batch file. In addition, the for, goto, and if commands allow 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 programs. The replaceable parameter, %, expands batch script argument variables.