Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

What's the equivalent of the DOS "sleep" command in the XP command prompt window?

Posted on 2003-11-04
11
Medium Priority
?
27,873 Views
Last Modified: 2012-08-14
I want to do the following from a .bat file under Windows XP

run a program
wait 5 seconds
run another program

What's the Windows XP command for "wait 5 seconds".  I tried "sleep" but that doesn't seem to be supported.
0
Comment
Question by:wile_e_coyote
10 Comments
 
LVL 49

Expert Comment

by:sunray_2003
ID: 9680564
Check if this do the trick

http://www.jsifaq.com/SUBO/tip7300/rh7307.htm

Sunray
0
 
LVL 4

Author Comment

by:wile_e_coyote
ID: 9680607
I tried that, but it doesn't work


C:\xxx>timeout /t 2
'timeout' is not recognized as an internal or external command, operable program or batch file.
0
 
LVL 49

Expert Comment

by:sunray_2003
ID: 9680696
Can you not use a for loop to delay the process

Sunray
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 48

Expert Comment

by:Mikal613
ID: 9680857
0
 
LVL 24

Expert Comment

by:Kenneniah
ID: 9680877
If the purpose of the delay is to wait until the first program is done to start the next use the Start command with the /wait option.

Start
Starts a separate Command Prompt window to run a specified program or command. Used without parameters, start opens a second command prompt window.

Syntax
start ["Title"] [/dPath] [/i] [/min] [/max] [{/separate | /shared}] [{/low | /normal | /high | /realtime | /abovenormal | belownormal}] [/wait] [/b] [FileName] [Parameters]

/wait
Starts an application and waits for it to end.
0
 
LVL 21

Expert Comment

by:gemarti
ID: 9681461
Why not do it in the task scheduler?
START | PROGRAMS | ACCESSORIES | SYSTEM TOOLS | Scheduled Tasks
0
 
LVL 4

Accepted Solution

by:
wile_e_coyote earned 0 total points
ID: 9681806
Ok - I found what I was looking for.  There's an XP compatible sleep.exe utility  in the NT Resource Kit

http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en

0
 
LVL 1

Expert Comment

by:nrlz
ID: 9692395
What you could do is leverage off the ping command since it supports Timeouts. For example to wait 4 seconds:

echo wait...
ping -n 1 -w 4000 10.0.0.0
echo finished waiting.
0
 
LVL 4

Author Comment

by:wile_e_coyote
ID: 9694022
I'm going to ask that this question be deleted since I found the sleep command (exactlly what I was looking for) in the Windows 2003 server resource kit
0
 

Expert Comment

by:amelbguy
ID: 34989001
Some online (sorry author can't remember location) gave this tidbit which was to insert a "ping" to an invalid host and set the wait time for the period you wish to wait.

e.g. PING 1.1.1.1 -n 1 -w 60000 >NUL

Smart thinking (outside the box).
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Migration of Exchange mailbox can be done with the ExProfre.exe tool. But at times, when the ExProfre.exe tool migrates the Exchange Server user profile, it results in numerous synchronization problems. Synchronization error messages appear in the e…
It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question