Try using the conditional execution & or the && between each command either with a copy and paste into the cmd.exe window or in a batch file. Additionally, you can use the double pipe || symbols instead to only run the next command if the previous command failed.
You can use batch scripts to run multiple commands and instructions on your machine simultaneously. Using a batch script, you will be able to execute all your commands one by one automatically.
Instead of scheduling multiple Windows Tasks that may overlap, use the "start /wait" command a batch file (. bat) to automatically run multiple commands in sequential order.
When you call another .bat file, I think you need "call" in front of the call:
call otherCommand.bat
You can use the && symbol between commands to execute the second command only if the first succeeds. More info here http://commandwindows.com/command1.htm
Not sure why the first command is stopping. If you can make it parallel, you can try something like
start cmd.exe /C 1.bat
start cmd.exe /C 2.bat
I have just been doing the exact same(ish) task of creating a batch script to run maven test scripts. The problem is that calling maven scrips with mvn clean install ... is itself a script and so needs to be done with call mvn clean install.
Code that will work
rem run a maven clean install
cd C:\rbe-ui-test-suite
call mvn clean install
rem now run through all the test scripts
call mvn clean install -Prun-integration-tests -Dpattern=tc-login
call mvn clean install -Prun-integration-tests -Dpattern=login-1
Note rather the use of call. This will allow the use of consecutive maven scripts in the batch file.
Using double ampersands will run the second command, only if the first one succeeds:
cd Desktop/project-directory && atom .
Where as, using only one ampersand will attempt to run both commands, even if the first fails:
cd Desktop/project-directory & atom .
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