Computing.Net > Forums > Windows XP > batch file for time delay in xp

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

batch file for time delay in xp

Reply to Message Icon

Name: aaron
Date: September 17, 2003 at 11:51:07 Pacific
OS: Xp
CPU/Ram: P4
Comment:

how to write a batch file to delay 30 seconds between the two command line in the batch file. for example, I need to use batch file to execute two .exe file, but I want the second one to be opened after some seconds. thanks in advance



Sponsored Link
Ads by Google

Response Number 1
Name: JAVED MIANDAD
Date: September 17, 2003 at 15:06:29 Pacific
Reply:

use wait switch to add the delay i.e:

/WAIT or /w Start application and wait for it to terminate.
n = number of seconds to wait from 1 to 99

example:

start example1.exe /w n
start example2.exe


Hope this helps.


0

Response Number 2
Name: Nathan
Date: September 17, 2003 at 17:54:41 Pacific
Reply:

I have never heard of the /w switch and apperently neither does CMD. I tried it didn't work. try this instead.

start "prog1.exe"
ping 1.1.1.1 -n 1 -w 30000
start "prog2.exe"


0

Response Number 3
Name: nathan
Date: September 17, 2003 at 17:55:46 Pacific
Reply:

opps I almost forgot. to surpress all that junk just a nul to the end. i.e.

ping 1.1.1.1 -n 1 -w 30000>nul



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: batch file for time delay in xp

Batch file for removing dupes www.computing.net/answers/windows-xp/batch-file-for-removing-dupes/179346.html

batch file for permissions www.computing.net/answers/windows-xp/batch-file-for-permissions/170216.html

Creating Batch files for XP www.computing.net/answers/windows-xp/creating-batch-files-for-xp/144010.html