Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting errorlevel from a called batch file

Tags:

batch-file

I have several batch files that I call from a parent batch file. I need to trap if there are any errors that occur in the child batch files. When a child batch file makes a call to an exe file, I am able to trap the error in the child batch file just fine. How do I surface it up to the parent batch file?

like image 730
user31673 Avatar asked Jul 08 '09 01:07

user31673


1 Answers

Exit with:

exit /b errorlevel

In your child batch script.

like image 191
akf Avatar answered Sep 18 '22 09:09

akf