home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cenvi23.zip / ERRLEV.CMD < prev    next >
OS/2 REXX Batch file  |  1995-03-31  |  892b  |  18 lines

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