Situation is, i have 3 separate batch files in different locations running start commands
on .jar .exe and call command to open index.html through Firefox.
I want to create one global batch-file to run all of these one at a time. Extra hint would be to make a pause (several seconds) in between calling each one of those commands.
These are the commands i am executing in batch files:
echo majmun1
call C:\OKOLINA\additionConsoleApplication1.exe
echo majmun2
call C:\OKOLINA\addition1\jWebSocketSamples-2.0.jar
echo majmun3
call firefox.exe C:\OKOLINA\addition2\index.html
echo majmun4
exit
It only executes call the first one and stops.
You need to use start istead:
echo majmun1
start C:\OKOLINA\additionConsoleApplication1.exe
echo majmun2
start C:\OKOLINA\addition1\jWebSocketSamples-2.0.jar
echo majmun3
start firefox.exe C:\OKOLINA\addition2\index.html
echo majmun4
exit
If you want to make a pause between starts, then you can use this little hack:
command 1
ping -w 1000 -n 5 127.0.0.1
command 2
It pings localhost 5 times (-n 5) and waits 1000ms (-w 1000) between each ping, effectively delaying execution of command 2 for 5 seconds. (You can't use pause as it waits for a user to press Enter and there is no built-in delay command).
Use start instead of call to launch your applications.
call calls one batch program from another (The filename parameter must have a .bat or .cmd extension).
On the other hand, start starts a separate command prompt window to run a specified program or command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With