batch file to open 2 progs with time delay
Can anyone tell me how to write a batch file to open 2 programs, the first to open immediately and the second one with a 20 second delay after the first one? Like for example, I would like to open Google Earth first and then want to open another programs Event Manager 20 seconds after Google Earth? How can I do that? Thanks.
Re: batch file to open 2 progs with time delay
You can try to 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--
RE: batch file to open 2 progs with time delay
I dont think it is possible by batch commands, but a very simple script will do this:
; Delay.au3
; Compile with AutoIt 3.x, http://www.techarena.in
; Usage in batch: Delay {seconds}
Opt ("TrayIconHide",1)
if $cmd[0] > 0 then
$thisDelay=$cmd[1] * 1000
sleep($thisDelay)
endif
exit