Solved

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

Posted on 2003-11-04
11
27,571 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
11 Comments
 
LVL 49

Expert Comment

by:sunray_2003
Comment Utility
Check if this do the trick

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

Sunray
0
 
LVL 4

Author Comment

by:wile_e_coyote
Comment Utility
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
Comment Utility
Can you not use a for loop to delay the process

Sunray
0
 
LVL 48

Expert Comment

by:Mikal613
Comment Utility
0
 
LVL 24

Expert Comment

by:Kenneniah
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 21

Expert Comment

by:gemarti
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now