|
| 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
Add:
Del.icio.us |
Digg |
Furl |
My Yahoo!
Discuss This Tip
Print This Tip
Get E-Mail When New Tips are Online
Return to the Windows XP and DOS page. |