home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Current Shareware 1994 January
/
SHAR194.ISO
/
virus
/
virchk2a.zip
/
VIRCHECK.BAT
< prev
next >
Wrap
DOS Batch File
|
1993-07-27
|
5KB
|
180 lines
@rem -- VIRCHECK.BAT v2.0a
@rem -- Validates archive, performs virus check and comments
@rem -- ZIP and ARJ files automatically!
@rem -- Jointly developed by Gary Gilmore (1:2410/400)
@rem -- and Gary Weinfurther (1:120/301)
@rem -- MS-DOS (command.com) VERSION
@ECHO OFF
rem ───────────────────────────────────────
rem Make sure the VIRUS directory exists
rem ───────────────────────────────────────
C:
IF NOT EXIST \VIRUS\NUL md \VIRUS
rem ───────────────────────────────────────────────────
rem Make sure the unzipping directory exists
rem ───────────────────────────────────────────────────
:MakeDir
IF NOT EXIST \VIRUS\UL\NUL MD \VIRUS\UL
CD \VIRUS\UL
rem ───────────────────────────────────────────────────────────
rem Move the contents of the upload to the unzipping directory
rem ───────────────────────────────────────────────────────────
ECHO.>COM1
ECHO Now processing %2%3... >COM1
IF "%3" == ".ZIP" GOTO IsZip
IF "%3" == ".ARJ" GOTO IsArj
IF "%3" == ".LZH" GOTO IsLzh
IF "%3" == ".COM" GOTO Copy
IF "%3" == ".EXE" GOTO Copy
IF "%3" == ".ZOO" GOTO IsZoo
IF "%3" == ".ARC" GOTO IsArc
IF "%3" == ".BAT" GOTO IsBat
IF "%3" == ".PAK" GOTO IsPak
IF "%3" == ".CPT" GOTO IsMac
IF "%3" == ".SEA" GOTO IsMac
IF "%3" == ".SIT" GOTO IsMac
GOTO Copy : File is unknown type
:IsZip
ECHO UnZipping %2%3... >COM1
pkunzip -o %1%2%3
IF ERRORLEVEL 1 GOTO Corrupt
goto Scan
:IsArj
ECHO Extracting %2%3... >COM1
arj e -n -y %1%2%3
IF ERRORLEVEL 1 GOTO Corrupt
goto Scan
:IsLzh
ECHO Melting %2%3... >COM1
lha e /m %1%2%3
IF ERRORLEVEL 1 GOTO Corrupt
goto Scan
:Copy
XCOPY %1%2%3
GOTO Scan
:IsBat
rem BAT FILES NOT ALLOWED
del %1%2%3
copy %4NO_BATS.BBS %4FILE_BAD.BBS
GOTO End
:IsArc
rem ARC FILES NOT ALLOWED
del %1%2%3
copy %4NO_ARCS.BBS %4FILE_BAD.BBS
GOTO End
:IsPak
rem PAK FILES NOT ALLOWED
del %1%2%3
copy %4NO_PAKS.BBS %4FILE_BAD.BBS
GOTO End
:IsZoo
ECHO Oozing %2%3 >COM1
zoo e %1%2%3
IF ERRORLEVEL 1 GOTO Corrupt
goto Scan
:IsMac
rem MAC FILES NOT CHECKED
copy C:\MAX\MISC\FILE_MA.BBS C:\MAX\MISC\FILE_OK.BBS
GOTO End
:NotFound
copy %4FNOTFOUN.BBS %4FILE_BAD.BBS
goto End
rem ───────────────────────────────────────
rem Scan the contents for a virus
rem ───────────────────────────────────────
:Scan
copy C:\MAX\MISC\FILE_IB.BBS C:\MAX\MISC\FILE_OK.BBS
ECHO Scanning %2%3.....>COM1
SCAN \VIRUS\UL /A /NOMEM /NOPAUSE /HISTORY C:\VIRUS\VSCAN.LOG
IF ERRORLEVEL 2 GOTO Aborted
IF ERRORLEVEL 1 GOTO Virus
rem ────────────────────────────────────────────────────────────
rem Insert ZIP or ARJ comment
rem ────────────────────────────────────────────────────────────
:Comment
IF "%3" == ".ZIP" zcp -Z%1%2%3 -C\max\comment.zh -L
IF "%3" == ".ARJ" arj c %1%2%3 /zC:\max\comment.zh
GOTO End
rem =================================================
rem ERROR CONDITIONS:
rem =================================================
rem ───────────────────────────────────────
rem Archive is corrupted
rem ───────────────────────────────────────
:Corrupt
del %1%2%3
copy %4FCORRUPT.BBS %4FILE_BAD.BBS
GOTO End
rem ───────────────────────────────────────
rem A virus was found
rem ───────────────────────────────────────
:Virus
xcopy %1%2%3 \virus
del %1%2%3
copy %4FVIRUS.BBS %4FILE_BAD.BBS
ECHO ╔══════════════╗>>\virus\virus.log
ECHO ║ Virus Log ║>>\virus\virus.log
ECHO ╚══════════════╝>>\virus\virus.log
ECHO ────────────────────────────────────────────────────────>>\virus\virus.log
ECHO *** VIRUS FOUND in %2%3 *** >> \virus\virus.log
ECHO. >> \virus\virus.log
ECHO SCAN.EXE Reports the following: >> \virus\virus.log
ECHO ────────────────────────────────────────────────────────>> \virus\virus.log
ECHO. >> \virus\virus.log
type c:\virus\vscan.log >> c:\virus\virus.log
del c:\virus\vscan.log
makemsg -X\max\virusmsg.cfg
del c:\virus\virus.log
GOTO End
rem ───────────────────────────────────────
rem Virus scan abnormally aborted
rem ───────────────────────────────────────
:Aborted
xcopy %1%2%3 \virus
del %1%2%3
copy %4FCORRUPT.BBS %4FILE_BAD.BBS
ECHO Error while scanning %2%3. The Sysop has been informed.>COM1
ECHO ╔══════════════╗>>\virus\virus.log
ECHO ║ Virus Log ║>>\virus\virus.log
ECHO ╚══════════════╝>>\virus\virus.log
ECHO ────────────────────────────────────────────────────────>>\virus\virus.log
ECHO ERROR while scanning %2%3>>\virus\virus.log
ECHO. >> \virus\virus.log
ECHO SCAN.EXE Reports the following: >> \virus\virus.log
ECHO ────────────────────────────────────────────────────────>>virus.log
ECHO. >> \virus\virus.log
type c:\virus\vscan.log >> c:\virus\virus.log
del c:\virus\vscan.log
makemsg -X\max\virusmsg.cfg
del c:\virus\virus.log
GOTO End
rem ───────────────────────────────────────
rem All done - Clean up
rem ───────────────────────────────────────
:End
ECHO Y|del \virus\ul > nul
del c:\virus\vscan.log
CD\MAX