Sleep before starting app using BAT file?

N

Noozer

I have a BAT file that runs at boot and launches my email client as well as
some other apps.

Is there any way to launch these apps after a time delay, in a separate
thread? I want to have the email and news clients to start after 20 seconds
or so. It would be great if this 20 seconds wouldn't stop the rest of the
BAT from executing.

--- My BAT file ----------

@echo off

echo Mounting network shares...

net use /persistent:no

net use i: \\server\internet
net use l: \\server\downloads
net use m: \\server\media
net use r: \\server\archive
net use x: \\server\documents

echo Linking IE Favourites...
regedit /s LanFavorites.reg

echo Starting Email and News... (how can I make these wait 20+ seconds
before starting?)
start outlook
start msimn.exe /newsonly
 
M

Mark L. Ferguson

Create a wait script

--wait4me.vbs--cut here--
wscript.sleep 60000 'waits 6o seconds , in thousanths of a sec
--cut here-

then call the script from a batch file with a wait till the script is over

--go.bat--
time
start /WAIT .\wait4me.vbs
time
pause
--cut here--

..
 
N

Noozer

Create a wait script
--wait4me.vbs--cut here--
wscript.sleep 60000 'waits 6o seconds , in thousanths of a sec
--cut here-
Mark L. Ferguson (NOT an MS-MVP)

Thanks muchly!
 
Z

Z

Noozer said:
I have a BAT file that runs at boot and launches my email client as well as
some other apps.

Is there any way to launch these apps after a time delay, in a separate
thread? I want to have the email and news clients to start after 20 seconds
or so. It would be great if this 20 seconds wouldn't stop the rest of the
BAT from executing.

Download the Windows 2003 Resource Kit from microsoft.com (or buy the
Windows XP Resource Kit book and CD) and use SLEEP.EXE in your .BAT
file(s). It works fine. I use it to start a pseudo-service N minutes
after every reboot.

Windows 2003 Resource kit download is here: http://tinyurl.com/6p6cy

Windows XP Resource Kit book and CD can be found at your local bookseller.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top