├OMMAND: IF ╙YNTAX: IF EXIST PATTERN COMMAND IF STRING1 = STRING2 COMMAND IF ERRORLEVEL N COMMAND ╙EE ┴LSO: ┬┴╘├╚, ┬┼╟╔╬, ╠╧╧╨, ╟╧╘╧, ╟┼╘╦┼┘, ; IF IS USED TO CONTROL THE ACTION TAKEN INSIDE BATCH FILES. ├OMMAND CAN BE A ┬┴╙╔├ COMMAND OR A ├╙-─╧╙ COMMAND. ╧NLY A FEW ├╙-─╧╙ COMMANDS RETURN ERRORLEVELS THAT MAKE ANY SENSE.╒SUALLY THEY DON'T. ╔N GENERAL, THOUGH, AN ERRORLEVEL OF ZERO MEANSTHE COMMAND DID WHAT YOU EXPECTED IT TO DO AND ANY OTHER VALUE MEANSTHAT IT FAILED FOR ONE REASON OR ANOTHER. IF EXIST PATTERN COMMAND ╘HIS EXECUTES COMMAND ONLY IF THE FIRST FILE MATCHING PATTERN EXISTS. IF STRING1 = STRING2 COMMAND ╘HIS EXECUTES COMMAND ONLY IF THE TWO STRINGS ARE THE SAME. IF ERRORLEVEL N COMMAND ╘HIS EXECUTES COMMAND ONLY IF THE LAST COMMAND RETURNED AN ERRORLEVEL OF N. ╞OR EXAMPLE, HERE IS A BATCH FILE TO IMPROVE UPON THE DEL COMMAND.╠ETS SAY WE CALL THIS "ERASE" IF "%1" = " " GOTO USAGE IF "%2" = "IFON" GOTO DELIF DEL %1 %2 %3 %4 %5 %6 %7 %8 %9 GOTO DONE :DELIF IF "%3" = " " GOTO USAGE IF EXIST %3%1 DEL %1 GOTO DONE :USAGE ECHO USAGE %0 FILENAME [IFON D:] :DONE ; ╙O THAT INVOKING IT WITH ERASE NAME ╫OULD BE THE SAME AS DEL NAME ┬UT INVOKING IT WITH ERASE NAME IFON B: ╫OULD ONLY DELETE THE FILE IF A FILE WITH THE SAME NAME EXISTED ON DRIVE B: ╧R HERE IS A BATCH FILE TO ASSEMBLE AND REINSTALL SOME PROGRAM. ╙UPPOSE WECALL IT "ASSM", THEN INVOKE IT WITH -> ASSM NAME ASM %1.ASM %1 IF NOT ERRORLEVEL 0 GOTO ERROR REMOVE %1 INSTALL %1 GOTO DONE :ERROR ECHO ┴SSEMBLY ERROR. :DONE ;