@echo off
REM ** PCBTest ZIP Laboratory II
REM ** (C)1990 by Jeffrey S. Morley
REM ** Change all "Proecho 1" to "Proecho 1" for COM1:
REM ** Change paths to match your system

proecho 1 [2J
proecho 1 ~[1;37mÚÄÄÄÄÄÄÄÄÄÄÄ¿~
proecho 1 ³    [0;31mÛÛÛ    [1;37m³~
proecho 1 ³ [0;31mÜÜÜÛÛÛÜÜÜ [1;37m³  [1;37mWelcome to -YOUR NAME HERE- BBS .ZIP Lab!~
proecho 1 ³ [0;31mßßßÛÛÛßßß [1;37m³  [1;33mÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ[1;37m~
proecho 1 ³    [0;31mÛÛÛ    [1;37m³  [1;37m    ZIP Lab II - "Revenge of ZIP Lab"    ~
proecho 1 ÀÄÄÄÄÄÄÄÄÄÄÄÙ~


if not exist %1 goto NoFile

nameonly %1
call nameonly.bat
if exist nameonly.bat del nameonly.bat

proecho 1 ~[32mThe file(s) you uploaded will now undergo very extensive testing for

proecho 1 ~my users' safety.  Please be patient, this will be a minute...  Do NOT
  
proecho 1 ~drop carrier during the testing.  The file(s) will not be posted if you
 
proecho 1 ~do, and no upload credit will be awarded.  Thanks...~

standby 3

proecho 1 [9;1H
proecho 1 [32m                                                                              ~
proecho 1 [32m                                                                              ~
proecho 1 [32m                                                                              ~
proecho 1 [32m                                                                              ~
proecho 1 [9;1H

proecho 1 [14;1H
proecho 1 [1;34mÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿~
proecho 1 [1;34m³ [0;32mStatus of .ZIP Lab testing[1;34m                                                 ³~
proecho 1 [1;34mÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´~
proecho 1 [1;34m³[1;36m         CRC check of .ZIP file:[1;34m                                            ³~
proecho 1 [1;34m³[1;36m            Embedded .TD0 files:[1;34m                                            ³~
proecho 1 [1;34m³[1;36m            Embedded .ZIP files:[1;34m                                            ³~
proecho 1 [1;34m³[1;36m          Virus checking (SCAN):[1;34m                                            ³~
proecho 1 [1;34m³[1;36m          Removing ZIP comments:[1;34m                                            ³~
proecho 1 [1;34m³[1;36m           Removing advertising:[1;34m                                            ³~
proecho 1 [1;34m³[1;36m            Testing age (1988+):[1;34m                                            ³~
proecho 1 [1;34mÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

proecho 1 [8;1H
               
proecho 1 [1;34mÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿~
proecho 1 [1;34m³                                                                            ³~
proecho 1 [1;34mÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ~

proecho 1 [9;3H[0;32mSubject file:
proecho 1 [1;37m %TESTFILE

proecho 1 [11;1H
proecho 1 [1;34mÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿~
proecho 1 [1;34m³                                                                            ³~
proecho 1 [1;34mÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ~

proecho 1 [12;3H[0;32mCurrent test:

:zip
if exist pcbfail.txt del pcbfail.txt
proecho 1 [12;17H[1;32m
proecho 1 CRC errors using PKUNZIP.EXE
pkunZIP -t %1 >pcbfail.txt

if errorlevel 1 goto badupload
if exist pcbfail.txt del pcbfail.txt

proecho 1 [17;36H[1;32m
proecho 1 %TESTFILE contains no errors.

:CHKTD0
proecho 1 [12;17H[1;32m
proecho 1 Looking for embedded .TD0 files in %TESTFILE
chkinzip %1 .TD0
if NOT errorlevel 1 goto NoTD0

proecho 1 [12;17H[1;32m
proecho 1 Teledisk .TD0 file detected, testing with [1;37mTDCHECK...~
pkunzip %1 *.td0 c:\pktmp >NUL
c:\copypc\tdcheck c:\pktmp\*.td0 >pcbfail.txt
if errorlevel 1 goto BadTD0

if exist c:\pktmp\*.td0 del c:\pktmp\*.td0
if exist pcbfail.txt del pcbfail.txt
proecho 1 [18;36H[1;32m
proecho 1 .TD0 file contains no errors.~
goto CHKZIP

:NoTD0
proecho 1 [18;36H[1;32m
proecho 1 None detected.

:CHKZIP

proecho 1 [12;17H[1;32m
proecho 1 Looking for embedded .ZIP files in %TESTFILE
chkinzip %1 .ZIP
if NOT errorlevel 1 goto NoZIP

proecho 1 [12;17H[1;32m
proecho 1 Testing embedded .ZIP(s) for errors...
pkunzip %1 *.ZIP c:\pktmp >NUL
pkunzip -t c:\pktmp\*.zip >pcbfail.txt

if errorlevel 1 goto badupload
if exist pcbfail.txt del pcbfail.txt

proecho 1 [19;36H[1;32m
proecho 1 Embedded .ZIP file(s) contain no errors.
if exist c:\pktmp\*.* delf c:\pktmp\*.*
goto scan

:NoZIP
proecho 1 [19;36H[1;32m
proecho 1 None detected.

:scan
proecho 1 [12;17H[1;32m
proecho 1 Using SCANV to test for Virus infection...                  ~
if exist c:\pktmp\*.* delf c:\pktmp\*.* >NUL
pkunzip -o %1 c:\pktmp *.exe >NUL
pkunzip -o %1 c:\pktmp *.com >NUL
scan c:\pktmp  >NUL
if errorlevel 2 goto NoScan
if errorlevel 1 goto Virus
if exist c:\pktmp\*.* delf c:\pktmp\*.* >NUL

proecho 1 [20;36H[1;32m
proecho 1 No virus infection detected.

proecho 1 [12;17H[1;32m
proecho 1 Removing ZIP comments from %TESTFILE         ~
recom -o %1 >NUL

proecho 1 [21;36H[1;32m
proecho 1 Comments have been removed.

proecho 1 [12;17H[1;32m
proecho 1 Removing known BBS advertising files...       ~
chkinzip %1 arunme.com
if errorlevel 1 pkzip -d %1 arunme.com >NUL
chkinzip %1 poboxinc.com
if errorlevel 1 pkzip -d %1 poboxinc.com >NUL
chkinzip %1 hstsale!.com
if errorlevel 1 pkzip -d %1 hstsale!.com >NUL
chkinzip %1 readnow!.com
if errorlevel 1 pkzip -d %1 readnow!.com >NUL
chkinzip %1 darkside.com
if errorlevel 1 pkzip -d %1 darkside.com >NUL

proecho 1 [22;36H[1;32m
proecho 1 Advertising removed.

proecho 1 [12;17H[1;32m
proecho 1 Program age constraint = [34m1988 [32mor newer
testage %1 1988 d:\hold
if errorlevel 1 goto baddates

if exist pcbfail.txt del pcbfail.txt
proecho 1 [23;36H[1;32m
proecho 1 All files are 1988 or newer.              ~
goto end

:baddates
proecho 1 [14;1H
proecho 1 [1;34mÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿~
proecho 1 [1;34m³ [0;31mFile older than desired minimum (1988)![1;34m                                    ³~
proecho 1 [1;34mÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´~
proecho 1 [1;34m³                                                                            ³~
proecho 1 [1;34m³[1;31m One or more of the members of the .ZIP file are older than 1988.[1;34m           ³~
proecho 1 [1;34m³[1;31m I will move this .ZIP file offline for evaluation by the SysOp.[1;34m            ³~
proecho 1 [1;34m³                                                                            ³~
proecho 1 [1;34m³[1;31m Please do NOT upload files older than 1988.[1;34m                                ³~
proecho 1 [1;34m³                                                                            ³~
proecho 1 [1;34m³[1;31m File will not be posted, no upload credit awarded.[1;34m                         ³~
proecho 1 [1;34mÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ~
echo There is a problem with %1 >pcbfail.txt
if exist %1 copy %1 d:\hold >NUL
if exist %1 del %1
goto end

:badupload
proecho 1 [14;1H
proecho 1 [1;34mÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿~
proecho 1 [1;34m³ [0;31mFile has failed the CRC checking of PKUNZIP![1;34m                               ³~
proecho 1 [1;34mÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´~
proecho 1 [1;34m³                                                                            ³~
proecho 1 [1;34m³[1;31m The uploaded file has failed the CRC checking of PKUNZIP.          [1;34m        ³~
proecho 1 [1;34m³[1;31m I will move this .ZIP file offline for evaluation by the SysOp.[1;34m            ³~
proecho 1 [1;34m³                                                                            ³~
proecho 1 [1;34m³[1;31m You should check the file at your end, before uploading elsewhere.[1;34m         ³~
proecho 1 [1;34m³                                                                            ³~
proecho 1 [1;34m³[1;31m File will not be posted, no upload credit awarded.[1;34m                         ³~
proecho 1 [1;34mÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ~
echo There is a problem with %1 >pcbfail.txt
if exist %1 copy %1 d:\hold > NUL
if exist %1 del %1
goto end

:badTD0
if exist c:\pktmp\*.td0 del c:\pktmp\*.td0
proecho 1 [14;1H
proecho 1 [1;34mÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿~
proecho 1 [1;34m³ [0;31mEmbedded .TD0 file has failed checking with TDCHECK.EXE[1;34m                    ³~
proecho 1 [1;34mÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´~
proecho 1 [1;34m³                                                                            ³~
proecho 1 [1;34m³[1;31m The uploaded file has failed TD0 checking with TDCHECK.            [1;34m        ³~
proecho 1 [1;34m³[1;31m I will move this .ZIP file offline for evaluation by the SysOp.[1;34m            ³~
proecho 1 [1;34m³                                                                            ³~
proecho 1 [1;34m³[1;31m You should check the file at your end, before uploading elsewhere.[1;34m         ³~
proecho 1 [1;34m³                                                                            ³~
proecho 1 [1;34m³[1;31m File will not be posted, no upload credit awarded.[1;34m                         ³~
proecho 1 [1;34mÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ~
echo There is a problem with %1 >pcbfail.txt
if exist %1 copy %1 d:\hold
if exist %1 del %1
goto end

:NoScan
proecho 1 [14;1H
proecho 1 [1;34mÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿~
proecho 1 [1;34m³ [0;31m***** UNABLE TO SCAN FILE! *****                       [1;34m                    ³~
proecho 1 [1;34mÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´~
proecho 1 [1;34m³                                                                            ³~
proecho 1 [1;34m³[1;31m I was unable to SCAN this file for virus infection.                [1;34m        ³~
proecho 1 [1;34m³[1;31m I will move this .ZIP file offline for evaluation by the SysOp.[1;34m            ³~
proecho 1 [1;34m³                                                                            ³~
proecho 1 [1;34m³[1;31m You should check the file at your end, before uploading elsewhere.[1;34m         ³~
proecho 1 [1;34m³                                                                            ³~
proecho 1 [1;34m³[1;31m File will not be posted, no upload credit awarded.[1;34m                         ³~
proecho 1 [1;34mÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ~
echo There is a problem with %1 >pcbfail.txt
if exist %1 copy %1 d:\hold
if exist %1 del %1
goto end

:Virus
proecho 1 [14;1H
proecho 1 [1;34mÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿~
proecho 1 [1;34m³ [0;31m***** A VIRUS WAS DETECTED! *****                               [1;34m           ³~
proecho 1 [1;34mÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´~
proecho 1 [1;34m³                                                                            ³~
proecho 1 [1;34m³[1;31m A VIRUS WAS DETECTED IN THIS .ZIP FILE!                            [1;34m        ³~
proecho 1 [1;34m³[1;31m This transaction has been recorded in VIRUS.LOG for the SysOp.     [1;34m        ³~
proecho 1 [1;34m³                                                                            ³~
proecho 1 [1;34m³[1;31m ***** DO NOT UPLOAD THIS FILE TO ANY OTHER BBS SYSTEM! *****       [1;34m        ³~
proecho 1 [1;34m³[1;31m I recommend that you do NOT run this program on your computer.     [1;34m        ³~
proecho 1 [1;34m³[1;31m File will not be posted, no upload credit awarded.[1;34m                         ³~
proecho 1 [1;34mÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ~
echo VIRUS DETECTED! >C:\TEMP\VIRUS.LOG
echo Virus found in %1 >>C:\TEMP\VIRUS.LOG
echo There is a problem with %1 >pcbfail.txt
if exist %1 del %1
goto end

:NoFile
proecho 1 ~[37m%1 [31mwas not recieved.  
goto out

:end
proecho 1 [12;17H[1;32m
proecho 1 Leaving the lab, [33mthanks for uploading!    [1;0m
proecho 1 [24;1H~

:out

