I have three batch files say parent.bat, child1.bat & child2.bat. The parent batch file calls child1 and child2 batch file. If let's say child1.bat exits with error code 1 then my Parent.bat file does not fails and continue executing child2.bat.
My question is how can I capture error code of child1.bat/child2.bat file and fails the Parent.bat file accordingly.
I have the following code in place:
REM CHILD1.bat
echo "Executing CHILD1.bat"
call "%WORKSPACE%/tools/CHILD1.bat"
echo "Executed CHILD1.bat"
REM CHILD2.bat
echo "Executing CHILD2.bat"
call "%WORKSPACE%/tools/CHILD2.bat"
echo "Executed CHILD2.bat"