This tip was printed from the MalekTips Computer and Technology Help and Tips website at http://malektips.com.

Windows XP and DOS - Pause Batch Files with a User-Defined Message

SUMMARY: Pause a Windows XP batch file with a prompt other than "Press any key to continue."

To pause a DOS batch file in Windows XP from continuing to the next command, you can use the PAUSE command. Doing so prompts the user with the text:

Press any key to continue . . .

Then the batch file waits for the user to press a key. However, what if you want to pause a batch file and not display anything? Just pipe the results to nul like so:

pause > nul

Since this may not be very useful (how will the user know they need to press a key to continue the batch file?) you should display a different prompt. Issue an ECHO command with your desired prompt, then issue the above pause > nul command.

For example, to pause a Windows XP batch file with the prompt "Press ENTER to execute the command", use the following commands:

echo Press ENTER to execute the command
pause > nul


 


Press the "print" button on your browser or select "File" - "Print" to print this tip. Then, return to Windows XP and DOS - Pause Batch Files with a User-Defined Message
 
Standard disclaimer applies - read http://malektips.com/disclaim.html.