If I make a script package called temp.bat (for example) containing:
exit /b 1
When I launch it in various ways, I get a different behavior on my 32-bit XP system and 64-bit XP system.
In 32-bit mode:
> temp.bat
> echo %ERRORLEVEL%
1
> cmd /c temp.bat
> echo %ERRORLEVEL%
0
In 64-bit mode:
> temp.bat
> echo %ERRORLEVEL%
1
> cmd /c temp.bat
> echo %ERRORLEVEL%
1
I looked at the cmd.exe parameters, and I could not find any parameters that control how it distributes error level information from batch scripts. At the moment, I can not find a rational explanation for this difference.
source
share