Solved How can I pause a batch file for 'n' seconds?

April 26, 2011 at 21:13:39
Specs: Windows XP
I'm trying to pause a batch file for 'n' seconds so as to display an echo message for 'n' seconds and then move on to more commands. I've tried Sleep and Choice, but neither was working for me :\ This is MS-DOS (cmd.exe) in case you're wondering...Maybe if someone explained options for the sleep or choice commands, that might help.

See More: How can I pause a batch file for n seconds?

Report •

April 26, 2011 at 23:54:30
✔ Best Answer
SLEEP and CHOICE aren't available to XP command prompt.

Apparently you can use the PING command to force a delay:

In the example there the delay is 2 seconds.

There's also a link there to windows 2003 resource kit that has a sleep command and it implies you can use it for XP.

An internet search should turn up a lot of other methods that may or may not work with XP.

Obama's a 2012'er. That explains EVERYTHING..

Report •

May 26, 2011 at 02:59:58
The following command works and pauses for 3 seconds and doesn't need any keyboard input

CHOICE /C N /D N /T:3 >nul

Report •

May 27, 2011 at 01:00:35
Nircmd can do this too.

nircmd.exe wait 2000

Example above pauses for 2 seconds in miliseconds.
Google for Nircmd


Happy is ONE who says I am an OttoMAN.

Report •

Related Solutions

May 27, 2011 at 23:35:36

Report •

Ask Question