In a batch file, I have an inconsistent errorlevel behavior:
The following code always gives errorlevel 0 in one location (somewhere in the middle - exactly where i need it) inside the batch file.
I copied only this snippet and placed it in the beginning and at the end of the batch file. In those locations, the result is always 1.
Here is the code snippet:
IF ERRORLEVEL 1 echo ERRORLEVEL is 1 or more
Any idea how to make it work also in the middle of the file? What am I doing wrong? I would hate to solve it with GOTOs(to the end of the file and back to where I need the result.)