I have a bat-file with 10 reg commands. I need bat-file at the end of its work display a message if at least 1 error is occurred and pause.
I have read this manuals http://ss64.com/nt/if.html http://ss64.com/nt/errorlevel.html and they are completely unclear. As I see there are 2 variables ERRORLEVEL - system and local. But in many stackoverflow answers both variables are used: How do I make a batch file terminate upon encountering an error? check if command was successfull in a batch file So if some application return some code simultaneously with bat-file I can get wrong behaviour. So I need local ERRORLEVEL. What should I do?