@echo off REM ************************************************************************ REM *** ERRLEV.BAT - Call a program, passing up to 8 parameters, and *** REM *** set the ERRLEV environment variable from the return *** REM *** Code of that program. Also return with ERRORLEVEL *** REM *** set as if the program was run directly from the *** REM *** command prompt or from a batch file. *** REM ************************************************************************ if not "%1" == "" GOTO RUN_ERRLEV ECHO ERRLEV - Call a program, passing up to 8 paramters. Sets ERRLEV environment ECHO variable to the value returned. Also set ERRORLEVEL for batch file. ECHO Example: ERRLEV CHKDSK C: :RUN_ERRLEV CEnvi return(ERRLEV = spawn(P_WAIT,`%1 %2 %3 %4 %5 %6 %7 %8 %9`));