I have 2 separate sets of batch commands that are run independently in separate files. I figured out how to create a single batch file to execute both using the following:
CALL %0\..\"MyBatchFile.bat"
if errorlevel 0 (
REM do some additional commands here
)
This actually works perfectly and then I only have to run 1 batch file to execute everything. However it still requires 2 separate batch files. What I want to do is replace that call to the external batch file and have the calls from that file directly in a single batch file.
Issue is I can't figure out the syntax to essentially behave the same but with only a single file:
Execute the 2nd set of statements, only after the 1st set has finished without error.
I tried using the &&
operator between sets of statements but it didn't execute both sets of statements. Any idea how to have all statements within a single file and only execute the 2nd set after the 1st set has finished successfully?