Re: batch file to open 2 progs with time delay

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Copy/paste this into notepad (don't use Word or Wordpad)
and save it as "Andrew.bat"

start "C:\Program Files\Google\Google Earth Pro\googleearth.exe"
echo wscript.sleep 20000 > temp.vbs
start /wait temp.vbs
start "C:\Documents and Settings\Andrew\Desktop\DUMP\EventManager\EventManager.exe"
del temp.vbs




"Andy" <andyNOSPAM@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:rfHJNnIGREd1PPPkandyNOSPAM@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Sorry Bill, i'm a little thick and still don't get it. Do i just paste
that into a .txt doc and save it as a .bat file then execute it ???,
where do the program links go in ??? Sorry if i appear clueless, but i
am (thats why i posted here !)

Best Regards,
Andrew



Bill Blanton:
Based on Tom's example, you could do-

start first.exe
echo wscript.sleep 20000 > temp.vbs
start /wait temp.vbs
start second.exe
del temp.vbs

This still uses the WSH, but the bat creates the script on the fly.


"Andy" <andyNOSPAM@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:rCdteGZihghWsJVnandyNOSPAM@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Sorry Mark, i don't understand any of that. Just wanted an example
that
i could tailor to my own needs. Do you know (based on my needs) what
the
exact text file (bat) would look like ?

Best Regards,
Andrew




Mark L. Ferguson:
You can 'start' a script file from the bat file, and use the
argument
to
'wait' till it returns. This could be a script that waits 20
seconds
before
returning.

---example.bat--
start first.exe
start /wait myscript.vbs
start second.exe
--end file--

--myscript.vbs
wscript.sleep 20000
--end file--
--
Mark L. Ferguson
e-mail subject line must include "QZ" or it's deleted
.
"Andy" <andyNOSPAM@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:cKvha1HhABxciUOWandyNOSPAM@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

Could anyone please tell me how i write a batch file (.bat) to
open
2
programs, the first to open immediately and the second one with a
20
second delay after the first one ??

for example:

I want to open Google Earth first (on my PC it is : C:\Program
Files\Google\Google Earth Pro\googleearth.exe)

Then i want to open another program (Event Manager) 20 seconds
after
Google Earth (this program is at C:\Documents and
Settings\Andrew\Desktop\DUMP\EventManager\EventManager.exe on my
PC)

I have tried, but i cannot get it to work.


Best Regards,
Andrew




.



Relevant Pages