Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

pause

Feedback

In this article

Suspends the processing of a batch program, displaying the prompt,Press any key to continue . . .

Syntax

pause

Parameters

ParameterDescription
/?Displays help at the command prompt.

Remarks

  • If you press CTRL+C to stop a batch program, the following message appears,Terminate batch job (Y/N)?. If you pressY (for yes) in response to this message, the batch program ends and control returns to the operating system.

  • You can insert thepause command before a section of the batch file that you might not want to process. Whenpause suspends processing of the batch program, you can press CTRL+C and then pressY to stop the batch program.

Examples

To create a batch program that prompts the user to change disks in one of the drives, type:

@echo off:Begincopy a:*.*echo Put a new disk into Drive Apausegoto begin

In this example, all the files on the disk in Drive A are copied to the current directory. After the message prompts you to put a new disk in Drive A, thepause command suspends processing so that you can change disks and then press any key to resume processing. This batch program runs in an endless loop—thegoto begin command sends the command interpreter to the Begin label of the batch file.

Related links


Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

  • Last updated on

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?