|
求助批处理高手啊,能否帮小弟一个忙!!
把下面这段不长的批处理命令一行一行单独解释一下意思好吗?感激涕零!!!!!
@ECHO OFF
SET PTFS=945,915,865,855,845,830,815,810,
SET EX=
SET CMDS=
SET LP=
FOR %%I IN (%PTFS%) DO IF EXIST I%%IDIAG.EXE SET EX=I%%IDIAG
IF NOT "%EX%"=="" GOTO START
ECHO.
ECHO Error! 8xx/9xx executable not found.
ECHO.
GOTO END
REM Process the loop parameter this batch file.
:START
IF "%1"=="" GOTO RUN
REM If 'loop' param, set flag and remove.
REM
IF "%1"=="loop" SET LP=Y
IF "%1"=="loop" SHIFT
IF "%1"=="loop" GOTO START
REM Section overcomes DOS's nine parameter limit.
REM Collect all the non loop command line args.
REM
IF NOT "%1"=="" SET CMDS=%CMDS% %1
SHIFT
GOTO START
REM Call the exe with all the parameters.
:RUN
%EX%%CMDS%
ECHO .
IF ERRORLEVEL 2 GOTO FAIL
IF ERRORLEVEL 1 GOTO ABORT
IF "%LP%"=="Y" GOTO RUN
IF ERRORLEVEL 0 GOTO PASS
ECHO INVALID RETURN CODE
GOTO END
:PASS
ECHO Pass
GOTO END
:FAIL
ECHO Fail
GOTO END
:ABORT
echo incomplete
GOTO END
:END
ECHO .
REM Clean up environment
FOR %%I IN (EX,CMDS,PTFS,LP,LPF) DO SET %%I= |
|