I have these two lines in my batch script:
call pre.bat
call post.bat
And I have a exit condition in pre.bat (i.e. exit 255)
How can I execute post.bat even if pre.bat exits with an error code?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
exit /b 255instead ofexit 255in your pre.batIf you cannot change pre.bat, then you can use
start /b /wait pre.batinstead ofcall pre.bat. But then all changes to environment variables that pre.bat might have made will be lost.