Solved

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

Posted on 2003-11-04
11
27,650 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 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
Independent Software Vendors: 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Disclosure: Use this tutorial only when no other options helps to get Windows XP running without any problems and you don't want to format the drive. The back up of the data is the responsible of the user, however there is a description of how t…
Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

734 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