Contents of the DLCHECK.DOC file
by Duane Paulson
Copyright (c) 1990, 1991 Duane Paulson
DLCHECK.BAT is a batch file intended to automate the process of checking
downloaded files for computer virus. License is given to individuals and orga-
nizations to implement as many copies of DLCHECK.BAT as required without the
payment of registration fees. You may modify copies of DLCHECK.BAT for inter-
nal use. However, if distributed, DLCHECK.BAT must be distributed in its
original form. DLCHECK.DOC (this document) must be included in the archive
package (or on the distribution disk) with DLCHECK.BAT. The public domain
file SETER.EXE must also be included in the distribution package.
DLCHECK.DOC may not be modified under any circumstance.
DLCHECK.BAT ver. 1.2 is the same as ver. 1.1. SETERR.EXE required a slight
bugfix. See SETERR.DOC for details.
ACKNOWLEDGEMENTS AND CREDITS:
SCAN Copyright 1989-90 by McAfee Associates
PKUNZIP (R) Copr. 1989-1990 PKWARE Inc. PKUNZIP Reg. U.S. Pat. and Tm. Off.
PKUNPAK Copyright (c) 1986-1988 PKWARE Inc.
LHarc Copyright (c) Haruyasu Yoshizaki, 1988-89.
Pak Copyright 1988-89 NoGate Consulting
Public domain Looz extractor/lister/tester by Rahul Dhesi
You will need:
The latest version of SCAN.EXE (VIRUSCAN) by McAfee Associates. Be sure to
keep current with this
If you download files in .ZIP format, you will need the latest version of
If you download files in .ARC format, you will need PKUNPAK, available as part
If you download files in .LZH format, you will need the latest version of
If you download files in .PAK format, you will need the latest version of PAK.
If you download files in .ZOO format, you will need the latest version of
LOOZ. ZOO.EXE will not work with DLCHECK, since it will not accept wildcards.
LOOZ is a necessity.
The DLCHECK.BAT file itself, and
SETERR.EXE, which is distributed with DLCHECK.
DLCHECK.BAT has been tested on DOS 3.30.
The above files must be in your comm subdirectory, or available on your DOS
DLCHECK writes to the DOS environment. If you haven't already done so, I
recommend adding the following line to your CONFIG.SYS file:
SHELL=C:\COMMAND.COM /P /E:2048
DLCHECK looks for newly downloaded files in a subdirectory called \NEW_FILE.
You will need to create this subdirectory on your disk, and modify your comm
software to download files into this subdirectory. Note that this subdirectory
is meant to be cleaned out after every comm session, so don't store any
permanent files in \NEW_FILE. They will be deleted.
For best results, DLCHECK should be run from a batch file as an extension of
your comm program. I recommend a batch file of the following sort:
REM Replace the following line with your comm program
REM After your comm session is over, you will want to run DLCHECK
command /c /e:2048 dlcheck.bat
REM I recommend the above form of calling DLCHECK instead of
REM "call dlcheck.bat" because "call" does not preserve the size
REM of the DOS environment.
REM If DLCHECK terminates normally and without detecting virii,
REM errorlevel will be set to 0.
if errorlevel 0 if not errorlevel 1 copy \new_file\*.* \YOUR_DOWNLOAD_DIR
REM Now all that's left to do is delete the files in \new_file
REM if no virii have been found.
if errorlevel 0 if not errorlevel 1 del \new_file\*.*
if errorlevel 0 if not errorlevel 1 cd \YOUR_COMM_DIR
Ideally, you should name this batch file something that is easier to type in
than the name of your comm program, since that will give you incentive to use
it. Perhaps you are already using a batch file with your comm program, to set
download parameters, etc. If so, you can just add the DLCHECK calling routine
on to it. The idea is to make DLCHECK so much a part of your comm routine,
that it is automatically called each time you run your comm program.
HOW DLCHECK OPERATES.
DLCHECK will scan downloaded archive files to two levels of archiving. That
is, it will open and inspect an archive within an archive. If an archive
within an archive within an archive is found, DLCHECK will not open the ar-
chive nested to the third level. No doubt there are legitimate reasons for
nesting an archive to three levels, but you should proceed with caution
nevertheless. A message will be displayed if a third-level nested archive is
Note: Due to the nature of LOOZ, all nested archives, to any number of levels,
are opened with a wildcard command. If you download ZOO format files, try to
get a look at them with an online viewer, if available.
DLCHECK will display messages to the screen from the various unarchiving pro-
grams and SCAN.EXE as they are run. DLCHECK will also present a summary of
results just before it terminates. In addition, DLCHECK will cause DOS error-
levels to be generated so that the results of DLCHECK can be utilized by other
programs. I feel that errorlevels are more reliable than trying to pass en-
vironmental variables between batch files. According to the DOS manual, the
"cloned" environment is not preserved upon return to the calling batch pro-
Upon termination, SCAN.EXE passes one of three errorlevels (exit codes) to
0 - Normal termination, no viruses found
1 - One or more viruses found
2 - Abnormal termination (Error)
Since SCAN may be run up to three times during a DLCHECK session, I have
devised a hierarchy for preserving errorlevels passed by SCAN:
1 - Viruses found. Highest priority. Termination of SCAN with error-
level 1 on any running will result in DLCHECK terminating with
an errorlevel of 1.
2 - Abnormal termination. This errorlevel will be passed to DOS by
DLCHECK only if no viruses were found on another running of SCAN
in the current DLCHECK session.
0 - Normal termination, no viruses found. Lowest priority. This
errorlevel will be returned if, and only if, SCAN.EXE terminated
with errorlevel 0 on all its passes.
Errorlevels are passed from DLCHECK to DOS through the use of SETERR.EXE.
It replaces the ERRLV-n.COM programs that were distributed with the first
version. SETERR.EXE sets an errorlevel of 0 to 255. The errorlevel is passed
to SETERR as a command line parameter. See SETERR.DOC for more information.
Feel free to use SETERR.EXE with your own batch files.