Windows Batch File Differences

Issue NT/2000/XP 95/98/ME
Error level
if errorlevel n ...
or
if "%errorlevel%"=="n" ...
or
if not errorlevel n ...
or
if not "%errorlevel%"=="n" ...
Neither reliable nor consistent.
Variables
setlocal
...
set somevar=somevalue
...
endlocal
set somevar=somevalue
...
set somevar=
Local Variables
setlocal
...
set somevar=somevalue
...
endlocal
set oldsomevar=%somevar%
set somevar=somevalue
...
set somevar=%oldsomevar%
set oldsomevar=



Back to main