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 >
Text File  |  1994-02-19  |  8KB  |  156 lines

  1.  
  2.                       EXPLANATION OF THE COMMANDS USED
  3.                            IN THE SAMPLE CHKUP.BAT
  4.  
  5.  
  6.         Before attempting to explain the sample CHKUP.BAT file included 
  7.     in the SFCHKUP.ZIP distribution package, it should be noted that a 
  8.     number of assumptions are being made.  These assumptions include:
  9.   
  10.           1)  SFCHKUP is being executed on drive C:
  11.  
  12.           2)  Both SFCHKUP and SPITFIRE have been configured to use the
  13.               directory CHKUP1 (node 1) to place files uploaded to the BBS
  14.         
  15.           3)  A directory on drive C: named UTILITY (i.e., C:\UTILITY) is 
  16.               where all the utility programs accessed during the processing
  17.               of this batch file are placed.  This would include MUV.EXE,
  18.               TOZIP.EXE, PKUNZIP.EXE, PKZIP.EXE, SCAN.EXE, DELXCEPT.COM,
  19.               and RECOM.EXE.  You should be able to download each of these
  20.               files from Buffalo Creek's BBS:
  21.  
  22.               MUV.EXE      download MUV*.ZIP
  23.               TOZIP.EXE    download ZIP-KIT9.ZIP
  24.               PKUNZIP.EXE  download PKZ*.EXE
  25.               PKZIP.EXE    download PKZ*.EXE
  26.               SCAN.EXE     download SCAN*.ZIP
  27.               DELXCEPT.COM download DELXCEPT.ZIP
  28.               RECOM.EXE    download RECOM*.ZIP
  29.  
  30.           4)  A directory on drive C: exists called BADCHKUP (i.e. C:\BADCHKUP)
  31.               is used to move any files there which either fail the integrity
  32.               check or are found to contain a virus.
  33.  
  34.     You will need to modify this batch file to match the configuration of your
  35.     system if you are not using the paths defined above.  With this in mind,
  36.     the explanation (enclosed in parenthesis) of the commands (upper case 
  37.     letters) sample batch file follows:
  38.  
  39.  
  40.  
  41. @ECHO OFF
  42.                       (Eliminates the commands executed during the processing
  43.                       of the batch file from being displayed to the screen.)
  44.   C:
  45.                       (Changes to drive C: of the computer system.)
  46.   CD\CHKUP1
  47.                       (Changes to the directory CHKUP1.)
  48.   MD CHKWORK
  49.                       (Creates a working directory called CHKWORK.)
  50.   C:\UTILITY\MUV %1%2 \CHKUP1\CHKWORK
  51.                       (Calls the utility MUV, located in the UTILITY directory
  52.                       on drive C: to move the uploaded file(s) to the working
  53.                       directory.)
  54.   CD CHKWORK
  55.                       (Changes to the newly created working directory.)
  56.   IF EXIST *.ARC C:\UTILITY\TOZIP *.ARC
  57.                       (If the uploaded file is an ARC file compression format,
  58.                       the utility TOZIP is used to convert it to the ZIP file
  59.                       compression format.)
  60.   IF EXIST *.ZIP C:\UTILITY\PKUNZIP *.ZIP
  61.                       (If the uploaded file is a ZIP file, the utility PKUNZIP
  62.                       decompresses the file.)
  63.   IF ERRORLEVEL 1 GOTO TEST_BAD
  64.                       (If while unzipping the ZIP file, any errors are detected
  65.                       PKUNZIP will return an Errorlevel of 1.  If this should
  66.                       happen, the batch file skips to the batch file label
  67.                       TEST_BAD.)
  68.   IF EXIST COMMAND.COM DEL COMMAND.COM
  69.                       (If COMMAND.COM was included in the .ZIP file then
  70.                       this command will erase it.)
  71.   IF EXIST PKUNZIP.EXE DEL PKUNZIP.EXE
  72.                       (If PKUNZIP.EXE was included in the .ZIP file then
  73.                       this command will erase it.).
  74.   IF EXIST PKZIP.EXE DEL PKZIP.EXE
  75.                       (If PKZIP.EXE was included in the .ZIP file then
  76.                       this command will erase it.)
  77.   C:\UTILITY\SCAN *.* /NOMEM
  78.                       (McAfee's SCAN program is used to test any files
  79.                       in the current directory for known viruses.)
  80.   IF ERRORLEVEL 1 GOTO TEST_BAD
  81.                       (The SCAN utility will return an Errorlevel of 1 if
  82.                       a virus is detected.  If this should happen the batch
  83.                       file skips to the batch file label, TEST_BAD.)
  84.   IF ERRORLEVEL 0 GOTO TEST_OK
  85.                       (The SCAN utility will return an Errorlevel of 0 if
  86.                       no viruses are detected.  If this should happen the
  87.                       batch file skips to the batch file label, TEST_OK.)
  88. :TEST_BAD
  89.                       (If an Errorlevel of 1 was returned either while
  90.                       unzipping the file or scanning for a virus, the
  91.                       batch file label of TEST_BAD is called to continue 
  92.                       processing files which failed the testing.)
  93.   C:\UTILITY\MUV %1%2 \BADCHKUP
  94.                       (Moves the uploaded file(s) to the directory BADCHKUP.
  95.                       This command is only necessary if you wish to examine
  96.                       the file that was uploaded.  If you are not interested
  97.                       in saving files which do not pass all tests, simply
  98.                       omit this line of the batch file.  If this line is
  99.                       omitted, the C:\BADCHKUP directory is not needed.)
  100.   C:\UTILITY\DELXCEPT %^$$^%!!.%^$
  101.                       (Deletes any files in the current directory, except
  102.                       one which might be named %^$$^%!!.%^$.  It is a
  103.                       pretty safe assumption no such file name will exist,
  104.                       therefore all files will be deleted.)
  105.   GOTO END
  106.                       (Skips to the batch file label END for additional
  107.                       processing.)
  108. :TEST_OK
  109.                       (If the uploaded file(s) pass the file integrity 
  110.                       checking and virus scan successfully, this batch
  111.                       file label is used to further process the uploaded
  112.                       file(s).)
  113.   IF EXIST *.ZIP C:\UTILITY\RECOM -S C:\UTILITY\COMMENT.FIL *.ZIP
  114.                       (A text file COMMENT.FIL should exist that contains
  115.                       your board's file comments.  If a ZIP file is found,
  116.                       the utility RECOM.EXE is used to replace any existing
  117.                       file comments with or add your comments to the ZIP file.)
  118.   IF EXIST %1.ZIP GOTO ZIPONLY
  119.                       In the event the processed file is a .ZIP file then
  120.                       this batch file branches to the ZIPONLY label.
  121.   C:\UTILITY\MUV %1.* \CHKUP1
  122.                       In the event the processed file is not a .ZIP file,
  123.                       then it is moved back to the original directory (CHKUP1).
  124.   GOTO CLEANDIR
  125.                       The batch file now branches to the CLEANDIR label. 
  126. :ZIPONLY
  127.   C:\UTILITY\MUV %1.ZIP \CHKUP1
  128.                        The processed .ZIP file is now moved back to the 
  129.                        original directory (CHKUP1).
  130. :CLEANDIR
  131.   C:\UTILITY\DELXCEPT !@#$%^&*.)(*
  132.                       Deletes all files in the current directory.
  133. :END
  134.                       (This batch file label executes the final processing 
  135.                       commands.)
  136.   CD..
  137.                       (Change back to the CHKUP1 directory after all
  138.                       processing has been completed.)
  139.   RD CHKWORK
  140.                       (Removes the working directory that was created earlier
  141.                       to be used for processing the uploaded file(s).)
  142.  
  143.   CD\SF
  144.                        Changes back to the SF (SPITFIRE HOME directory)
  145.                        directory.
  146. *** NOTE ***
  147.    If a file with an extension other than ARC or ZIP is uploaded to the
  148. BBS (for instance, *.TXT, *.LZH, *.ARJ, etc.) and you are using this sample 
  149. CHKUP batch file, the uploaded files will be compressed into a .ZIP file.
  150.  
  151. The sample CHKUP.BAT file which is included in the SFCHKUP package is
  152. basically for demonstration purposes.  The CHKUP.BAT file can be created
  153. to perform simple (somewhat elementary tasks) such as the sample or it can
  154. be created to perform extremely complex tasks.  Basically, SFCHKUP is limited
  155. only by the Sysop's ability to write the CHKUP.BAT file.
  156.