<> wrote...
> Here is a sample batch file that will set the errorlevel environment
> variable correctly from with in a batch file
>
> @echo off
> set ERRORCODE=234
> exit /B %ERRORCODE%
Actually there's no need to define a separate %ERRORCODE% variable, you can
use a literal. The following would also work:
@echo off
exit /B 234
You might decide to have a %ERRORCODE% variable for reasons of programming
style; but it's not functionally required, just to set the %ERRORLEVEL%.
(Also it might be easy to confuse the user-defined %ERRORCODE% and
system-supplied %ERRORLEVEL% identifiers).
--
Andrew McLaren
amclar (at) optusnet dot com dot au
|