------------------------ MS-DOS v6.22 Help: Pause --------------------------
<Notes> <Examples> <Index>
----------------------------------------------------------------------------
PAUSE
Suspends processing of a batch program and displays a message that prompts
the user to press any key to continue. You can use this command only within
batch programs.
Syntax
PAUSE
***
<Syntax> <Examples>
----------------------------------------------------------------------------
PAUSE--Notes
Prompting the user to continue the program
MS-DOS displays the following message in response to the PAUSE command:
Press any key to continue . . .
Dividing a batch file into sections
If you press CTRL+C to stop a batch program, MS-DOS displays the following
message:
Terminate batch job (Y/N)?
If you press Y (for yes) in response to this message, the batch program ends
and control returns to the operating system. Therefore, you can insert the
PAUSE command before a section of the batch file you may not want to
process. While PAUSE suspends processing of the batch program, you can press
CTRL+C and then Y to stop the batch program.
***
<Syntax> <Notes>
----------------------------------------------------------------------------
PAUSE--Example
Suppose you want a batch program to prompt the user to change disks in one
of the drives. To do this, you might create the following file:
@echo off
:begin
copy a:*.*
echo Please put a new disk into drive A
pause
goto begin
In this example, all the files on the disk in drive A are copied to the
current directory. After the displayed comment prompts you to place another
disk in drive A, the PAUSE command suspends processing so that you can
change disks and then press any key to resume processing. This particular
batch program runs in an endless loop. The GOTO BEGIN command sends the
command interpreter to the begin label of the batch file. To stop this batch
program, press CTRL+C and then Y.
***
----------------------------------------------------------------------------
<Top of page>
|
Last update: December 07, 2002 14:45 by Content © 1997 Microsoft Corporation All else © 2000-2005 |