Computer Guys... Help with creating a batch file.
Computer Guys... Help with creating a batch file.
I know I know I should know this, obviously I don't, I am new to batch files...
After several hours of browsing the web I still can't figure this out.
I want to create a batch file to start several programs simultaneously in a sequence with a time delay of 5-10 seconds between the start of each.
But all I can get it to do is start the next program after the first is terminated... arrrgggg!
Would someone care to please give me a working script for win xp so that I can see what I'm doing wrong.
Thank you.
@echo Off
cls
CD "C:\Program Files\Messenger"
msmsgs.exe
REM | CHOICE /C:AB /T:A,5 > NUL
CD "C:\Program Files\Yahoo!\Messenger"
YPager.exe
REM | CHOICE /C:AB /T:A,5 > NUL
CD "C:\Program Files\EarthLink\Protection Control Center"
elnk_pcc.exe
echo on
close
After several hours of browsing the web I still can't figure this out.
I want to create a batch file to start several programs simultaneously in a sequence with a time delay of 5-10 seconds between the start of each.
But all I can get it to do is start the next program after the first is terminated... arrrgggg!
Would someone care to please give me a working script for win xp so that I can see what I'm doing wrong.
Thank you.
@echo Off
cls
CD "C:\Program Files\Messenger"
msmsgs.exe
REM | CHOICE /C:AB /T:A,5 > NUL
CD "C:\Program Files\Yahoo!\Messenger"
YPager.exe
REM | CHOICE /C:AB /T:A,5 > NUL
CD "C:\Program Files\EarthLink\Protection Control Center"
elnk_pcc.exe
echo on
close
Originally Posted by dzervit
This is how you create a delay (in this example, 5 second).
TYPE NUL | CHOICE.COM /N /CY /TY,5 >NUL

TYPE NUL | CHOICE.COM /N /CY /TY,5 >NUL

when I replace (REM | CHOICE /C:AB /T:A,5 > NUL) with that then it just runs the first program then when I close the program (in this case MSN messenger) now it just closes the dos too, stops the batch process.
Last edited by PSS-Mag; May 29, 2006 at 08:47 PM.
How would you write the script?
program .exe locations are
C:\Program Files\Messenger\msmsgs.exe
C:\Program Files\Yahoo!\Messenger\YPager.exe
C:\Program Files\EarthLink\Protection Control Center\elnk_pcc.exe
I want all programs to run at the same time, I dont want to close one for the next to start, which is all I can get it to do so far.
program .exe locations are
C:\Program Files\Messenger\msmsgs.exe
C:\Program Files\Yahoo!\Messenger\YPager.exe
C:\Program Files\EarthLink\Protection Control Center\elnk_pcc.exe
I want all programs to run at the same time, I dont want to close one for the next to start, which is all I can get it to do so far.
Oh wait - XP doesn't have CHOICE anymore... your screwed on that one. You can try playing with the SET command (that replaced choice) but I don't see a clear way to set a delay. Why not just find a DOS pause/sleep/delay program?!
Go to this site and download the timeout program... just answer yes, you have a license... works like a champ.
http://www.dynawell.com/support/ResKit/winnt.asp
It's the timeout.exe from the Windows resource kit...
http://www.dynawell.com/support/ResKit/winnt.asp
It's the timeout.exe from the Windows resource kit...
Use the sleep command between each exe launch , good sample here http://malektips.com/xp_dos_0002.html, also has a tip were you can call another bat file that does a local loopback ping to give you a ten second delay.
Trending Topics
nah screw all that....
just substitute your commands...just make sure you use the Dos 8.3 naming convention, no spaces (ie program files)
just substitute your commands...just make sure you use the Dos 8.3 naming convention, no spaces (ie program files)
start C:\Windows\system32\calc.exe
start c:\progra~1\tivo\desktop\tivodesktop.exe
:end
start c:\progra~1\tivo\desktop\tivodesktop.exe
:end
Originally Posted by PSS-Mag
How would you write the script?
program .exe locations are
C:\Program Files\Messenger\msmsgs.exe
C:\Program Files\Yahoo!\Messenger\YPager.exe
C:\Program Files\EarthLink\Protection Control Center\elnk_pcc.exe
I want all programs to run at the same time, I dont want to close one for the next to start, which is all I can get it to do so far.
program .exe locations are
C:\Program Files\Messenger\msmsgs.exe
C:\Program Files\Yahoo!\Messenger\YPager.exe
C:\Program Files\EarthLink\Protection Control Center\elnk_pcc.exe
I want all programs to run at the same time, I dont want to close one for the next to start, which is all I can get it to do so far.
Download the timeout, then make you file look like this:
timeout 3
start /b C:\Program Files\Yahoo!\Messenger\YPager.exe
timeout 3
start /b c:\windows\system32\notepad.exe
You can obviously set your town timeout and start it with an @echo off...
Originally Posted by vader716
I dont get the need for the timeouts....why do you want a delay built in?
You know, if you just wrote a VBS script you could do all kinds of cool chit.
Well I'm trying to save clicks.
If I let these programs load on start up then they all load at the same time. They all have to connect to thier servers and it takes 2 minutes or more when they load at the same time. Mainly it's the earthlink protection center causeing it and the others to hang up. If I can wait 5-10 seconds and let one load and connect before the next one starts then they can all 3 be loaded and connected in about 40 seconds or less. Then stick a short cut to that batch file in my start up folder, then I wont have to click anything and beable to use the computer faster on start ups.
So far non of these have worked.... I'm aggrevated, so going to leave it alone for a while.
Yea I dont know VBS either..... LOL
If I let these programs load on start up then they all load at the same time. They all have to connect to thier servers and it takes 2 minutes or more when they load at the same time. Mainly it's the earthlink protection center causeing it and the others to hang up. If I can wait 5-10 seconds and let one load and connect before the next one starts then they can all 3 be loaded and connected in about 40 seconds or less. Then stick a short cut to that batch file in my start up folder, then I wont have to click anything and beable to use the computer faster on start ups.
So far non of these have worked.... I'm aggrevated, so going to leave it alone for a while.
Yea I dont know VBS either..... LOL


