
This is an upload checking batch file for GAP BBS software I wrote
using extended 4Dos commands.  You are free to use this as you see fit
and modify the hell out of it if you need to.

-------------------------------------------
What is required to run this batch file?
-------------------------------------------

You must be running 4Dos 5.0 or better.  That's it.



--------------------------------------
What does this batch file do?
--------------------------------------

This batch file will do several things.  It will:

         1. Check the integrity of ZIP, ARJ, LZH, and ARC files.
            It'll check more but you have to add those checking
            routines in yourself.

         2. It will use MacAfee's SCAN.EXE to check for viruses in the
            archive file.

         3. It will check to make sure that no file in the archive is
            older than a date you set.

         4. It will kill off any pesky BBS ad files.  You can
            indicate up to 5 files to kill off.

         5. It will extract any FILE_ID.DIZ or DESC.SDI files from an
            archive so GAP can import them.

         6. It will add a header file to each file it checks.  This
            works ONLY for ZIP files.

         7. It will check the integrity of GIF files.

         8. It will delete files that fail an archive integrity check,
            a virus check, and GIFs that fail their integrity check.
            It will move old files offline to a seperate directory
            that you indicate.

         9. It will keep an ongoing log of all checks it does.
            Telling you who uploaded a file, at what time, the status
            of the file, etc.  You indicate the name of the log file.

        10. It works in ANSI and monochrome modes.  It does not have
            any RIP ability but RIP callers will see the ansi output
            of the batch file.

        11. This batch file can be set to not check files uploaded by
            users with a high enough access level.



--------------------------------------
What do you need to make this run?
--------------------------------------

You have to have several files before this batch file will work
correctly.  These shouldn't be any trouble to get since most sysops
already have these on their boards.  The following files get called
upon by this batch file:

         PKZIP.EXE and PKUNZIP.EXE
         ARJ.EXE
         LHA.EXE
         PKPAK.EXE and PKUNPAK.EXE
         SCAN.EXE (The MacAfee virus scanner)
         GIFTEST.EXE (Dave Navarro's Gif testing program.)

Those are the only programs that are needed.  They should be accessible
along your system PATH.  They do not have to be in your GAP directory.

This batch file can also call on a fossil driver to manager the text
output of the batch file.  Sometimes a fossil is needed so the comm port
will not be overrun by the output which could result in the remote
caller dropping carrier or being disconnected.  Any fossil driver will
work.  The on and off settings for the fossil you use must be indicated
in the configuration file.



-----------------------------
Customizing UPCHECK.BAT
-----------------------------

This UPCHECK.BAT file calls on a configuration file to give it
information about various things.  This configuration file sets 18
different pieces of information the batch file may or may not need.
The name of this file is UPCHECK.CFG and must be located in the
directory of the node that calls this upcheck batch file.  The break
down is as follows:

  Setting Name   Description
  ------------   ----------------------------------------------------
   sysdir         The directory path to your GAP program directory.
                  This tells the batch file where to find DOOR.SYS.
                  Do not supply a trailing backslash.

   gendir         The directory path to your \GAP\GEN directory.  This
                  tells the batch file where to find TEXT.RIP.  Do not
                  supply a trailing backslash.

   workdir        The temp directory to use for checking files.  No
                  trailing backslash.  If you are using a copy of
                  this UPCHECK.BAT file in each of your node
                  directories of a multinode GAP BBS you need to
                  indicate unique temp directories for each BBS node
                  to work in.

   junkdir        The directory to hold files that do not pass the age
                  test.  This directory will also hold the log files
                  created by the upload checker.

   usefossil      A Yes or No to using a fossil driver.

   fossilon       The command to turn the fossil on.  If this must also
                  load the fossil and then turn it on, use the 4Dos
                  command separator (^).  An example might be:

                     c:\bnu\bnu.com /l0:38400^c:\bnu\bnu.com /I0+

                  If your fossil driver is already loaded, just indicate
                  the command line to turn the fossil on.

   fossiloff      The command to turn the fossil off.  If this must also
                  unload the fossil, use the 4Dos command separator.  An
                  example might be:

                     c:\bnu\bnu.com /I0-^c:\bnu\bnu.com /u

                  If the fossil driver only needs to be deactivated,
                  just indicate the deactivation command.

   nocheck        The access to not check.  I.E. users with this access
                  level and higher will not be forced to sit through the
                  checking process.  The uploaded file will still have
                  any ID file extracted and a ZIP comment added if that
                  is also set within the CFG file.

   portnum        The port number of the current node.  Use only a
                  number.  Do not use COM1 or COM2 or something like
                  that.

   addheader      Yes or No to adding a ZIP header command to all ZIP
                  file archives that get checked.

   headerfile     The full path and name of the header comment file to
                  add to ZIP files.

   maxage         The oldest date a file can be.  This is determined by
                  checking the date of all files within an uploaded
                  archive and finding the oldest dated file.  The date
                  of GIF files is not checked.  Age is entered in the
                  format 01-01-92.

   rptname        Name of the log file to create for this node.  If
                  you run a multinode BBS you should keep a separate
                  log file for EACH node.  Do not let the batch file
                  use the same log file for each node or you could
                  mess things up royally.  The log file will be created
                  in the junk directory.

   file1          The last five settings of the configuration file are
   file2          for you to name BBS ad files that you want deleted.
   file3          If you do not want any ad files killed, leave these
   file4          as xxxxxxxx.xxx. Actually these five lines can be
   file5          anything that won't get located in an archive.  I
                  just chose xxxxxxxx.xxx to make things simple.


The upcheck.bat file reads in these settings by using the SET /R command
to read them in as environment variables.  Using the SET /R command is a
great way of creating configuration files for batch files.

If this batch file fails in some way, it might be because you do not
have enough environment space for all of the environment variables this
batch file will create.  I suggest you have at least 2k of environment
space set aside.  This is configured in the SHELL line of your
CONFIG.SYS file by adding the parameter /E:2048 or within the 4DOS.INI
file by adding the INI directive ENVIRONMENT=2048.



------------------------------
Operation
------------------------------

This batch file will display locally as well as remotely.  The 4Dos
command TEE is used to redirect output to both a comm port and the local
screen.

This batch file uses only 1 parameter from GAP and that is %1, the file
name to be checked.  Well, I tell a lie.  It will draw on parameter 6
which tells the batch file if the check is being run on a local
connection.   You can use this batch file in GAPFILE to check files you
manually install via the Stray files commands off of the Utilities pull
down menu.


--------------------------------
Conclusion
--------------------------------

Have fun with this batch file.  I wrote it because I run my GAP BBS
under Windows and I could not get the Brainex File checker to run
smoothly.  This sucker works really fast because it gets loaded in BTM
mode.

If you are not running 4Dos this batch file is of no use to you.  I
advise everyone I know to use 4Dos as their command shell.  It blows
COMMAND.COM away.  If you are not to hip on some of the 4Dos batch file
language features, you can looks this batch file over to see some of
the potential of 4Dos.

If you want to contact me, my BBS number is 317-580-1531.  Upload a
file and see this batch file in action.  BTW, my name is David Wolfe.
