home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
UPCHECK
/
SFCHKUP.ZIP
/
CHKUPBAT.DOC
< prev
next >
Wrap
Text File
|
1994-02-19
|
8KB
|
156 lines
EXPLANATION OF THE COMMANDS USED
IN THE SAMPLE CHKUP.BAT
Before attempting to explain the sample CHKUP.BAT file included
in the SFCHKUP.ZIP distribution package, it should be noted that a
number of assumptions are being made. These assumptions include:
1) SFCHKUP is being executed on drive C:
2) Both SFCHKUP and SPITFIRE have been configured to use the
directory CHKUP1 (node 1) to place files uploaded to the BBS
3) A directory on drive C: named UTILITY (i.e., C:\UTILITY) is
where all the utility programs accessed during the processing
of this batch file are placed. This would include MUV.EXE,
TOZIP.EXE, PKUNZIP.EXE, PKZIP.EXE, SCAN.EXE, DELXCEPT.COM,
and RECOM.EXE. You should be able to download each of these
files from Buffalo Creek's BBS:
MUV.EXE download MUV*.ZIP
TOZIP.EXE download ZIP-KIT9.ZIP
PKUNZIP.EXE download PKZ*.EXE
PKZIP.EXE download PKZ*.EXE
SCAN.EXE download SCAN*.ZIP
DELXCEPT.COM download DELXCEPT.ZIP
RECOM.EXE download RECOM*.ZIP
4) A directory on drive C: exists called BADCHKUP (i.e. C:\BADCHKUP)
is used to move any files there which either fail the integrity
check or are found to contain a virus.
You will need to modify this batch file to match the configuration of your
system if you are not using the paths defined above. With this in mind,
the explanation (enclosed in parenthesis) of the commands (upper case
letters) sample batch file follows:
@ECHO OFF
(Eliminates the commands executed during the processing
of the batch file from being displayed to the screen.)
C:
(Changes to drive C: of the computer system.)
CD\CHKUP1
(Changes to the directory CHKUP1.)
MD CHKWORK
(Creates a working directory called CHKWORK.)
C:\UTILITY\MUV %1%2 \CHKUP1\CHKWORK
(Calls the utility MUV, located in the UTILITY directory
on drive C: to move the uploaded file(s) to the working
directory.)
CD CHKWORK
(Changes to the newly created working directory.)
IF EXIST *.ARC C:\UTILITY\TOZIP *.ARC
(If the uploaded file is an ARC file compression format,
the utility TOZIP is used to convert it to the ZIP file
compression format.)
IF EXIST *.ZIP C:\UTILITY\PKUNZIP *.ZIP
(If the uploaded file is a ZIP file, the utility PKUNZIP
decompresses the file.)
IF ERRORLEVEL 1 GOTO TEST_BAD
(If while unzipping the ZIP file, any errors are detected
PKUNZIP will return an Errorlevel of 1. If this should
happen, the batch file skips to the batch file label
TEST_BAD.)
IF EXIST COMMAND.COM DEL COMMAND.COM
(If COMMAND.COM was included in the .ZIP file then
this command will erase it.)
IF EXIST PKUNZIP.EXE DEL PKUNZIP.EXE
(If PKUNZIP.EXE was included in the .ZIP file then
this command will erase it.).
IF EXIST PKZIP.EXE DEL PKZIP.EXE
(If PKZIP.EXE was included in the .ZIP file then
this command will erase it.)
C:\UTILITY\SCAN *.* /NOMEM
(McAfee's SCAN program is used to test any files
in the current directory for known viruses.)
IF ERRORLEVEL 1 GOTO TEST_BAD
(The SCAN utility will return an Errorlevel of 1 if
a virus is detected. If this should happen the batch
file skips to the batch file label, TEST_BAD.)
IF ERRORLEVEL 0 GOTO TEST_OK
(The SCAN utility will return an Errorlevel of 0 if
no viruses are detected. If this should happen the
batch file skips to the batch file label, TEST_OK.)
:TEST_BAD
(If an Errorlevel of 1 was returned either while
unzipping the file or scanning for a virus, the
batch file label of TEST_BAD is called to continue
processing files which failed the testing.)
C:\UTILITY\MUV %1%2 \BADCHKUP
(Moves the uploaded file(s) to the directory BADCHKUP.
This command is only necessary if you wish to examine
the file that was uploaded. If you are not interested
in saving files which do not pass all tests, simply
omit this line of the batch file. If this line is
omitted, the C:\BADCHKUP directory is not needed.)
C:\UTILITY\DELXCEPT %^$$^%!!.%^$
(Deletes any files in the current directory, except
one which might be named %^$$^%!!.%^$. It is a
pretty safe assumption no such file name will exist,
therefore all files will be deleted.)
GOTO END
(Skips to the batch file label END for additional
processing.)
:TEST_OK
(If the uploaded file(s) pass the file integrity
checking and virus scan successfully, this batch
file label is used to further process the uploaded
file(s).)
IF EXIST *.ZIP C:\UTILITY\RECOM -S C:\UTILITY\COMMENT.FIL *.ZIP
(A text file COMMENT.FIL should exist that contains
your board's file comments. If a ZIP file is found,
the utility RECOM.EXE is used to replace any existing
file comments with or add your comments to the ZIP file.)
IF EXIST %1.ZIP GOTO ZIPONLY
In the event the processed file is a .ZIP file then
this batch file branches to the ZIPONLY label.
C:\UTILITY\MUV %1.* \CHKUP1
In the event the processed file is not a .ZIP file,
then it is moved back to the original directory (CHKUP1).
GOTO CLEANDIR
The batch file now branches to the CLEANDIR label.
:ZIPONLY
C:\UTILITY\MUV %1.ZIP \CHKUP1
The processed .ZIP file is now moved back to the
original directory (CHKUP1).
:CLEANDIR
C:\UTILITY\DELXCEPT !@#$%^&*.)(*
Deletes all files in the current directory.
:END
(This batch file label executes the final processing
commands.)
CD..
(Change back to the CHKUP1 directory after all
processing has been completed.)
RD CHKWORK
(Removes the working directory that was created earlier
to be used for processing the uploaded file(s).)
CD\SF
Changes back to the SF (SPITFIRE HOME directory)
directory.
*** NOTE ***
If a file with an extension other than ARC or ZIP is uploaded to the
BBS (for instance, *.TXT, *.LZH, *.ARJ, etc.) and you are using this sample
CHKUP batch file, the uploaded files will be compressed into a .ZIP file.
The sample CHKUP.BAT file which is included in the SFCHKUP package is
basically for demonstration purposes. The CHKUP.BAT file can be created
to perform simple (somewhat elementary tasks) such as the sample or it can
be created to perform extremely complex tasks. Basically, SFCHKUP is limited
only by the Sysop's ability to write the CHKUP.BAT file.