Useful DOS Batch Files Commands

Command

Purpose

call

Calls one batch program from another without causing the first batch program to stop.

choice

Prompts the user to make a choice in a batch program. Displays a specified prompt and pauses for the user to choose from among a specified set of keys.

echo

Displays or hides the text in batch programs when the program is running. Also indicates whether command-echoing is on or off.

for

Runs a specified command for each file in a set of files. You can use this command in batch programs or at the command prompt.

goto

Directs the operating system to a line in a batch program that is marked by a label you specify. You can use this command only in batch programs.

if

Performs conditional processing in batch programs. You can use this command only in batch programs.

pause

Suspends processing of a batch program and displays a message that prompts you to press any key to continue. You can use this command only in batch programs.

rem

Enables you to include comments (remarks) or prevent commands in a batch program or CONFIG.SYS from running.

shift

Changes the position of replaceable parameters in a batch program. You can use this command only in batch programs.