home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
BBS
/
QUPTST1.ZIP
/
PCBTEST.BAT
< prev
Wrap
DOS Batch File
|
1992-12-28
|
4KB
|
97 lines
rem . This is a quick batch file I threw together to allow quick testing
rem . of newly uploaded files. Like some, I got tired of the fancy upload
rem . testing programs drawing all of their pretty screens, so I decided
rem . to make up something that works fairly well, and most importantly,
rem . it works quickly. It is by no means fool proof, but for a quick
rem . perusal of the file, it works fine.
rem .
rem . I guess a quick disclaimer is in order here... I disclaim
rem . everything. If you use this batch file you are assuming all
rem . liablility for anything that occurs as a result of its use.
rem . You are free to modify, distribute or destroy this batch file in
rem . any way you see fit.
rem .
rem . There are a few parameters which require changing to match your
rem . system setup, I have gone through and marked them for quick
rem . editing. In order to make this batch file work properly, there
rem . you need to pick up a few more files, and they are as follows.
rem . TESTFIL3.ZIP - to test dates of files
rem . PCBDESCx.ZIP - to pull out FILE_ID.DIZ files
rem . SENDCOM.ZIP - to send messages through the com port
rem . STRIPZ12.ZIP - to strip comments from ZIP files
@echo off
md g:\uptest1 <--- change path
sendcom 2 CR <--- change com port
if not '%2' == 'UPLOAD' goto test_only
sendcom 2 ■ Stripping ZIP file comment
stripzip /R %1
sendcom 2 CR ■ Checking for File_Id.Diz or Desc.Sdi
pcbdesc %1 %3 /D
if errorlevel 5 goto end
sendcom 2 CR ■ Checking ZIP file integrity
unzip -t %1
if errorlevel 1 goto bad_zip
unzip %1 *.exe *.com *.sys *.ovl *.zip g:\uptest1 -O <--- change path
unzip g:\uptest1\*.zip *.exe *.com *.sys *.ovl g:\uptest1 -O <---change path
sendcom 2 CR ■ Scanning for viruses
scan g:\uptest1\*.* /nomem /fast <--- change path
if errorlevel 1 goto virus_found
sendcom 2 CR ■ Testing age of files
testfile 1988 1 g:\uptest1 <--- change path, date and percentage
if errorlevel 1 goto out_dated
goto dup_check
:BAD_ZIP
copy %1 d:\rejects <--- change path/make directory
erase %1
echo I'm sorry @FIRST@, @OPTEXT@ has failed the ZIP integrity check. >>PCBFAIL.TXT
echo It has been moved off-line pending further SysOp review. >>PCBFAIL.TXT
goto end
:VIRUS_FOUND
copy %1 d:\rejects <--- change path
erase %1
echo @FIRST@, @OPTEXT@ has been preliminarily flagged as "infected with >>PCBFAIL.TXT
echo a virus". The file has been moved off-line and the SysOp has been >>PCBFAIL.TXT
echo notified that this file is waiting for his review. >>PCBFAIL.TXT
goto end
:OUT_DATED
copy %1 d:\rejects <--- change path
erase %1
echo I'm sorry @FIRST@, @OPTEXT@ has been found to be older than 1/1/1988. >>PCBFAIL.TXT
echo In order to keep up-to-date software on the system, I require that >>PCBFAIL.TXT
echo files be newer than this date. However, the file has been moved >>PCBFAIL.TXT
echo off-line and the SysOp will review your upload. >>PCBFAIL.TXT
goto end
:TEST_ONLY
sendcom 2 ■ Testing ZIP file integrity
unzip -t %1 <--- change path
if errorlevel 1 goto bad_zip
unzip %1 *.exe *.com *.ovl *.sys *.zip g:\uptest1 <--- change path
unzip g:\uptest1\*.zip *.exe *.com *.ovl *.sys g:\uptest1 <--- change path
sendcom 2 CR ■ Scanning for viruses
scan g:\uptest1\*.* /nomem /fast <--- change path
if errorlevel 1 goto virus_found
goto end
rem vvvvvvvvvvvvv -- this part can be omitted if you are not using some type of
rem CRC duplicate checking program.
:DUP_CHECK
sendcom 2 CR ■ Checking for CRC duplication
zdcsfc %1 %2 %3
goto end
:end
delete g:\uptest1\*.* <--- change path
rd g:\uptest1 <--- change path