home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
d
/
d-chk102.zip
/
CHECKIT.BAT
next >
Wrap
DOS Batch File
|
1993-03-27
|
2KB
|
68 lines
@ECHO OFF
CLS
ECHO .
ECHO .
ECHO This is a trial BATCH file to illustrate how to use D-CHK.EXE
ECHO .
ECHO At the DOS prompt you should have typed "CHECKIT FILE_1 FILE_2"
ECHO where
ECHO FILE_1 is the name of the first file,
ECHO FILE_2 is the name of the second file.
ECHO .
ECHO If the file(s) are not in the current directory, include the
ECHO path(s) to the file(s).
ECHO .
ECHO .
ECHO The name you typed for FILE_1 was " %1 "
ECHO The name you typed for FILE_2 was " %2 "
ECHO .
PAUSE
CLS
ECHO D-CHK will now be called with the following command llne:
ECHO .
ECHO D-CHK %1 %2
ECHO .
PAUSE
CLS
ECHO D-CHK %1 %2 %3 %4
D-CHK %1 %2 %3 %4
echo .
echo .
ECHO .
ECHO Now back in the CHECKIT.BAT program.
ECHO .
ECHO The D-CHK program returned the following errorlevel:
IF ERRORLEVEL 5 GOTO 5
IF ERRORLEVEL 4 GOTO 4
IF ERRORLEVEL 3 GOTO 3
IF ERRORLEVEL 2 GOTO 2
IF ERRORLEVEL 1 GOTO 1
ECHO The ERRORLEVEL returned was 0
ECHO The TIME/DATES of the files are the same.
GOTO END
:6
ECHO The ERRORLEVEL returned was 6
GOTO END
:5
ECHO The ERRORLEVEL returned was 5
ECHO A command line error has occured
ECHO in calling the D-CHK program.
GOTO END
:4
ECHO The ERRORLEVEL returned was 4
ECHO File_1 could not be opened.
GOTO END
:3
ECHO The ERRORLEVEL returned was 3
ECHO File_2 could not be opened.
GOTO END
:2
ECHO The ERRORLEVEL returned was 2
ECHO File_2 is older than File_1
GOTO END
:1
ECHO The ERRORLEVEL returned was 1
ECHO File_1 is older than File_2
:END
ECHO .