Purpose:Suspend batch file or alias execution

 

Format:PAUSE [/= /Wn /C /T] [text]

 

/WnWait
/CClear the prompt
/TCountdown timer
textThe message to be displayed as a user prompt.

 

Usage:

 

A PAUSE command will suspend execution of a batch file or alias, giving you the opportunity to change disks, turn on the printer, etc.

 

PAUSE waits for any key to be pressed and then continues execution. You can specify the text that PAUSE displays while it waits for a keystroke, or let it use the default message:

 

Press any key when ready...

 

For example, the following batch file fragment prompts the user before erasing files:

 

pause Press Ctrl-C to abort, any other key to erase all .LST files

erase *.lst

 

If you press Ctrl-C or Ctrl-Break while PAUSE is waiting for a key, execution of an alias will be terminated, and execution of a batch file will be suspended while you are asked whether to cancel the batch job. In a batch file, you can handle Ctrl-C and Ctrl-Break yourself with the ON BREAK command.

 

PAUSE will remove any spaces before the prompt text. If you want to indent the message, you can use back quotes to preserve spaces:

 

pause `    `Press Ctrl-C to abort ...

 

Options:

 

/=Display the PAUSE command dialog to help you set the command line options. The /= option can be anywhere on the line; additional options will set the appropriate fields in the command dialog.

 

/CAfter you press a key, erase the prompt and do not print a CR/LF.

 

/TDisplays a countdown timer. Must be used with /Wn, which must be the first argument on the command line.

 

/WWait for a maximum of n seconds and then continue with the next command. If you combine /W and /C, /W must be the first argument on the command line.