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

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -

jQuery clickable div with working mailto link inside -