There are multiple problems in the current Windows batch commands (including geronimo.bat, startup.bat, etc.)
- It's not recommended to define an environment variable with the name ERRORLEVEL. See .
- Set a value to ERRORLEVEL has no effect to the exit code of the batch command (so the documented exit code "0" and "1" are not actually there).
- The value of the ERRORLEVEL variable will also get unset when the "@endlocal" command is called.