I\'m facing a weird situation where a batch file I wrote reports an incorrect exit status. Here is a minimal sample that reproduces the problem:
bug.cmd
The following is working ok invoking the bat with CALL:
bug.bat:
echo before if "" == "" ( echo first if exit /b 1 if "" == "" ( echo second if ) )
test.bat:
call bug.bat echo Exit Code is %ERRORLEVEL%
Exit Code is 1