Search This Blog

Infolinks

Saturday, November 3, 2012

Meet the command prompt - the pause command




This command is mostly used in batch scripts. What it does is simply to suspend processing/execution of the batch script until the user presses any key. It gives the prompt for the user to press any key to continue.

You may want to use this command when you want the user to see a particular output.

For example:
@echo off
echo Hello there!!
echo My name is Staphy
echo Nice meeting you.
echo I hope we'll get along very well
pause

The Pause Command
 

When this is put in a batch file and run, it will print out everything and wait for the user to press a key before the batch script is exited.
Were the pause not there, it will quickly print everything and exit before the user has the chance to even see what has been printed.