@echo off
REM ** PCBTest ZIP Laboratory
REM ** (C)1990 by Jeffrey S. Morley
REM ** Change all "Proecho 2" to "Proecho 1" for COM1:

proecho 1 [2J
proecho 1 ~[1;37m旼컴컴컴컴컴�~
proecho 1 �    [0;31m栢�    [1;37m�~
proecho 1 � [0;31m複蔔栢複� [1;37m�  [1;37mWelcome to The Interconnect BBS .ZIP Lab!~
proecho 1 � [0;31m賽賞栢賽� [1;37m�  [1;33m-----------------------------------------[1;37m~
proecho 1 �    [0;31m栢�    [1;37m�~
proecho 1 읕컴컴컴컴컴�~~


if not exist %1 goto NoFile

proecho 1 ~[32mThe file [37m%1 [32mwill now undergo~
proecho 1 very extensive testing, for my user's safety.~
proecho 1 ~Please be patient, this will be a minute...~

:zip
if exist pcbfail.txt del pcbfail.txt
proecho 1 ~1) Testing [37m%1 [32mfor CRC errors...~
pkunZIP -t %1 >pcbfail.txt

if errorlevel 1 goto badupload
if exist pcbfail.txt del pcbfail.txt

proecho 1    ZIP file contains no errors.~

chkinzip %1 .TD0
if NOT errorlevel 1 goto NoTD0

proecho 1 ~[1;32m   Teledisk .TD0 file detected, testing with [1;37mTDCHECK...~
pkunzip %1 *.td0 c:\pktmp >NUL
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 [1;32m   .TD0 file in [1;37m%1 [1;32mcontains no errors.~

:NoTD0

chkinzip %1 .ZIP
if NOT errorlevel 1 goto scan

proecho 1 ~   Testing embedded .ZIPs in [37m%1 [32mfor 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    Embedded .ZIP files contain no errors.~
if exist c:\pktmp\*.* delf c:\pktmp\*.*

:scan
proecho 1 ~2) Using SCANV to test for Virus infection...~
proecho 1    Please HOLD ON, this takes some time.~
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    No virus' in [37m%1~

proecho 1 ~[32m3) Removing comments from [37m%1...~
recom -o %1 >NUL

proecho 1    %1's [32mcomments removed.~

proecho 1 ~4) Removing BBS advertising files...~
chkinzip %1 arunme.com
if errorlevel 1 pkzip -d %1 arunme.com >NUL

proecho 1    Advertising removed.~

proecho 1 ~[32m5) Checking ages of member files...~
proecho 1    Program age constraint = [34m1989 [32mor newer~
testage %1 1989 d:\hold
if errorlevel 1 goto baddates

if exist pcbfail.txt del pcbfail.txt
proecho 1 [37m   %1 [32mpassed, and will be posted.~
goto end

:baddates
proecho 1 ~[31m  The .ZIP file [37m%1 [31myou uploaded~
proecho 1    is more than 2 years old.  I will move any old~
proecho 1    programs offline for evaluation by the sysop.~
proecho 1    [32mPlease do NOT upload items over 2 years old.~~
echo There is a problem with %1 >pcbfail.txt
if exist %1 copy %1 d:\hold
if exist %1 del %1
goto end

:badupload
proecho 1 [37m   %1 [31mFailed the .ZIP test!~
proecho 1 [32m   I will move it offline for manual evaluation.~
proecho 1    Please check your file to be sure it is ok.~
echo There is a problem with %1 >pcbfail.txt
if exist %1 copy %1 d:\hold
if exist %1 del %1
goto end

:badTD0
if exist c:\pktmp\*.td0 del c:\pktmp\*.td0
proecho 1 [37m   %1 [31mFailed the .TD0 test!~
proecho 1 [32m   I will move it offline for manual evaluation.~
proecho 1    Please check your file to be sure it is ok.~
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 ~[31m   ***** UNABLE TO SCAN *****
proecho 1    I recommend that you scan this~
proecho 1    file with a virus checker before~
proecho 1    uploading to other BBS systems.~
proecho 1 ~[32m   File moved offline for testing.~
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 ~[31m   ***** A VIRUS WAS DETECTED *****
proecho 1    It is highly recommended that you~
proecho 1    destroy this file without running!~
proecho 1    [33mPlease do not upload this file to~
proecho 1 any other bulletin board systems.~
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 [31mwas not recieved.  

:end
proecho 1 ~[32mLeaving the lab, [33mthanks for uploading![1;0m~

