exit - Why when a .bat file tests for %ERRORLEVEL% after running .NET app, it is testing for a string return type, not an int? -


i looking @ how run .net app command line, or in bat file, , code given testing %errorlevel% (the exiting return value) of application:

@if "%errorlevel%" == "0" goto success 

why testing "0" , not 0? understand it, .net executable returning int when exits, not string.

it's coercing numeric value string , comparing. can helpful if environment variable has no value %param% == 1 evaluate == 1 cause error.

for checking program's errorlevel, it's better evaluate per raymond chen's blog.

if errorlevel 1 echo error level 1 or more 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -