Computer Guys... Help with creating a batch file.

Old May 29, 2006 | 08:02 PM
  #1  
PSS-Mag's Avatar
Thread Starter
|
Senior Member
Joined: Dec 2004
Posts: 891
Likes: 1
From: Lost some where in the middle of the Ozark Mountains!
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
 
Reply
Old May 29, 2006 | 08:31 PM
  #2  
dzervit's Avatar
Senior Member
Joined: Apr 2004
Posts: 4,424
Likes: 0
From: Motor City
This is how you create a delay (in this example, 5 second).

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

 
Reply
Old May 29, 2006 | 08:45 PM
  #3  
PSS-Mag's Avatar
Thread Starter
|
Senior Member
Joined: Dec 2004
Posts: 891
Likes: 1
From: Lost some where in the middle of the Ozark Mountains!
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


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.
Reply
Old May 29, 2006 | 08:51 PM
  #4  
PSS-Mag's Avatar
Thread Starter
|
Senior Member
Joined: Dec 2004
Posts: 891
Likes: 1
From: Lost some where in the middle of the Ozark Mountains!
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.
 
Reply
Old May 29, 2006 | 08:59 PM
  #5  
dzervit's Avatar
Senior Member
Joined: Apr 2004
Posts: 4,424
Likes: 0
From: Motor City
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?!
 
Reply
Old May 29, 2006 | 09:13 PM
  #6  
dzervit's Avatar
Senior Member
Joined: Apr 2004
Posts: 4,424
Likes: 0
From: Motor City
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...
 
Reply
Old May 29, 2006 | 09:14 PM
  #7  
davidmf's Avatar
Member
Joined: Sep 2005
Posts: 61
Likes: 0
From: IL
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.
 
Reply

Trending Topics

Old May 29, 2006 | 09:16 PM
  #8  
vader716's Avatar
Senior Member
Joined: Jan 2003
Posts: 2,079
Likes: 0
From: Pikesville, MD
nah screw all that....

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
 
Reply
Old May 29, 2006 | 09:17 PM
  #9  
dzervit's Avatar
Senior Member
Joined: Apr 2004
Posts: 4,424
Likes: 0
From: Motor City
^ another Resource kit download. Sleep does the same thing as timeout, but I *thought* timeout was newer and supposed to use less CPU time... not that its major.
 
Reply
Old May 29, 2006 | 09:21 PM
  #10  
dzervit's Avatar
Senior Member
Joined: Apr 2004
Posts: 4,424
Likes: 0
From: Motor City
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.

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...
 
Reply
Old May 29, 2006 | 09:23 PM
  #11  
vader716's Avatar
Senior Member
Joined: Jan 2003
Posts: 2,079
Likes: 0
From: Pikesville, MD
I dont get the need for the timeouts....why do you want a delay built in?
 
Reply
Old May 29, 2006 | 10:00 PM
  #12  
dzervit's Avatar
Senior Member
Joined: Apr 2004
Posts: 4,424
Likes: 0
From: Motor City
Originally Posted by vader716
I dont get the need for the timeouts....why do you want a delay built in?
I don't get it either, but whatever... just givin' him what he wants.

You know, if you just wrote a VBS script you could do all kinds of cool chit.
 
Reply
Old May 29, 2006 | 10:34 PM
  #13  
PSS-Mag's Avatar
Thread Starter
|
Senior Member
Joined: Dec 2004
Posts: 891
Likes: 1
From: Lost some where in the middle of the Ozark Mountains!
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
 
Reply


Thread Tools
Search this Thread

All times are GMT -4. The time now is 05:22 AM.