home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carsten's PPE Collection
/
Carstens_PPE_Collection_2007.zip
/
T
/
THTCK21.ZIP
/
UPCHK.BAT
< prev
next >
Wrap
DOS Batch File
|
1994-07-06
|
9KB
|
304 lines
@ECHO OFF
IF %2 == UNZ GOTO UNZ
IF %2 == VIRUS GOTO VIRUS
IF %2 == DUP GOTO DUP
IF %2 == ADS GOTO ADS
IF %2 == REC GOTO REC
IF %2 == ADDIZ GOTO ADDIZ
GOTO END
:UNZ
REM MSDos 6.0+ Command to remove Work Directory
IF EXIST C:\TEMP%PCBNODE%\*.* DELTREE /Y C:\TEMP%PCBNODE%
REM 4DOS Command to delete all file's in TEMP Work Directory
rem IF EXIST C:\TEMP%PCBNODE%\*.* DEL C:\TEMP%PCBNODE% /Y/S/X
:MKDIR
REM *** I am useing DRIVE "C" for My work drive make sure you edit this
IF NOT EXIST C:\TEMP%PCBNODE% MD C:\TEMP%PCBNODE%
REM 4DOS Find File Extention
rem if %@ext[%1]==zip goto zip
rem if %@ext[%1]==lzh goto lzh
rem if %@ext[%1]==arj goto arj
REM *** If you are running straight DOS then use these lines below
REM DOS'S FIND FILE EXTENTION
testfile %1 LZH ARJ ZIP
IF ERRORLEVEL == 3 GOTO ZIP
IF ERRORLEVEL == 2 GOTO ARJ
IF ERRORLEVEL == 1 GOTO LZH
goto end
:ZIP
rem ■ ZIP archive detected
REM *** STRIP AUTHENTIC VERIFICATION ***
STRIPAV -p %1 >NUL
REM *** CHECK ZIP FOR CRC ERRORS ***
pkunzip %1 -d C:\TEMP%PCBNODE%
IF ERRORLEVEL == 50 GOTO ZIP_ERROR
IF ERRORLEVEL == 8 GOTO ZIP_ERROR
IF ERRORLEVEL == 2 GOTO ZIP_ERROR
IF ERRORLEVEL == 1 GOTO ZIP_ERROR
REM *** I RUN Antiad to remove BBS ADS if you don't then REM out the next
REM *** Three Lines and put your pkzip -d %1 @file.lst command in
C:\PCB\ANTI\antiad.exe -cC:\PCB\ANTI\antiad.cfg -pC:\TEMP%PCBNODE%\ -LC:\ANTI%PCBNODE%
IF EXIST C:\ANTI%PCBNODE% c:\util\pkzip {d %1 @C:\ANTI%PCBNODE%
IF EXIST C:\ANTI%PCBNODE% DEL C:\ANTI%PCBNODE%
REM ************************************************************************
REM **** The line Below is REQUIRED FOR AGE CHECKING!!!!! *****************
FV.COM %1 >%PCBDRIVE%%PCBDIR%\filelist.arc
REM ************************************************************************
REM **** The line Below is REQUIRED FOR DIZ insertion!!!!! ****************
IF EXIST C:\TEMP%PCBNODE%\FILE_ID.DIZ COPY C:\TEMP%PCBNODE%\FILE_ID.DIZ %PCBDRIVE%%PCBDIR%\DIZ.%PCBNODE%
IF EXIST C:\TEMP%PCBNODE%\*.ZIP MD C:\TEMP%PCBNODE%\TEMP%PCBNODE%
IF EXIST C:\TEMP%PCBNODE%\*.ZIP pkunzip -d -o C:\TEMP%PCBNODE%\*.ZIP C:\TEMP%PCBNODE%\TEMP\%PCBNODE%
IF ERRORLEVEL == 50 GOTO ZIP_ERROR
IF ERRORLEVEL == 8 GOTO ZIP_ERROR
IF ERRORLEVEL == 2 GOTO ZIP_ERROR
IF ERRORLEVEL == 1 GOTO ZIP_ERROR
goto end
:ARJ
REM ■ ARJ archive detected
REM ************************************************************************
REM **** The line Below is REQUIRED FOR AGE CHECKING!!!!! *****************
FV.COM %1 >%PCBDRIVE%%PCBDIR%\filelist.arc
arj x -x@exclude.lst %1 C:\TEMP%PCBNODE% >NUL
IF ERRORLEVEL == goto ZIP_ERROR
if errorlevel == 1 goto ZIP_ERROR
REM ************************************************************************
REM **** The line Below is REQUIRED FOR DIZ insertion!!!!! ****************
IF EXIST C:\TEMP%PCBNODE%\FILE_ID.DIZ COPY C:\TEMP%PCBNODE%\FILE_ID.DIZ %PCBDRIVE%%PCBDIR%\DIZ.%PCBNODE%
goto end
:LZH
REM ■ LHA archive detected
REM ************************************************************************
REM **** The line Below is REQUIRED FOR AGE CHECKING!!!!! *****************
FV.COM %1 >%PCBDRIVE%%PCBDIR%\filelist.arc
lha x %1 C:\TEMP%PCBNODE%\ >NUL
if errorlevel == 1 goto ZIP_ERROR
REM ************************************************************************
REM **** The line Below is REQUIRED FOR DIZ insertion!!!!! ****************
IF EXIST C:\TEMP%PCBNODE%\FILE_ID.DIZ COPY C:\TEMP%PCBNODE%\FILE_ID.DIZ %PCBDRIVE%%PCBDIR%\DIZ.%PCBNODE%
GOTO END_PROGRAM
:ZIP_ERROR
REM MSDos 6.0+ Command to remove Work Directory
IF EXIST C:\TEMP%PCBNODE%\*.* DELTREE /Y C:\TEMP%PCBNODE%
REM 4DOS Command to delete all file's in TEMP Work Directory
rem IF EXIST C:\TEMP%PCBNODE%\*.* DEL C:\TEMP%PCBNODE% /Y/S/X
REM ■ CRC ERROR!
ECHO FAILED TESTS: ARCHIVE CONTAINS ERRORS >%PCBDRIVE%%PCBDIR%\WORK\PCBFAIL.TXT
REM 4DOS MOVE COMMAND
rem MOVE %1 C:\bad.dir
REM DOS'S MOVE COMMAND
MOVE /Y %1 C:\bad.dir
GOTO END
rem *** REJECT FALSE FORMAT (LHA/ARJ) ***********************************
:INVALID
REM ■ LHA OR ARJ
ECHO FAILED TESTS: INVALID ARCHIVE (ARJ OR LHA) >%PCBDRIVE%%PCBDIR%\WORK\PCBFAIL.TXT
GOTO END
:VIRUS
if exist %PCBDRIVE%%PCBDIR%\FILELIST.ARC DEL %PCBDRIVE%%PCBDIR%\FILELIST.ARC
REM 4DOS Find File Extention
rem if %@ext[%1]==zip goto scan
rem if %@ext[%1]==lzh goto scan
rem if %@ext[%1]==arj goto scan
REM *** If you are running straight DOS then use these lines below
REM DOS'S FIND FILE EXTENTION
testfile %1 LZH ARJ ZIP
IF ERRORLEVEL == 3 GOTO scan
IF ERRORLEVEL == 2 GOTO scan
IF ERRORLEVEL == 1 GOTO scan
goto scan1
:SCAN
REM *** McAfee SCAN
REM SCAN C:\TEMP%PCBNODE%\*.* /NOMEM /NOPAUSE /NOEXPIRE /A
REM IF ERRORLEVEL == 1 GOTO VIRUS_FOUND
REM **** F-PROT
REM F-PROT C:\TEMP%PCBNODE% /NOMEM /ALL /NOBOOT
REM IF ERRORLEVEL == 1 GOTO VIRUS_FOUND
REM *** Scanning for Virus's ***
TBSCAN C:\TEMP%PCBNODE% af in se co nb nm nh ba II=4 >nul
IF ERRORLEVEL == 4 GOTO VIRUS_FOUND
IF ERRORLEVEL == 5 GOTO VIRUS_FOUND
GOTO ENDE
:scan1
REM *** McAfee SCAN
REM SCAN %1 /NOMEM /NOPAUSE /NOEXPIRE /A
REM IF ERRORLEVEL == 1 GOTO VIRUS_FOUND
REM **** F-PROT
REM F-PROT %1 /NOMEM /ALL /NOBOOT
REM IF ERRORLEVEL == 1 GOTO VIRUS_FOUND
REM *** Scanning for Virus's ***
TBSCAN %1 af in se co nb nm nh ba II=4 >nul
IF ERRORLEVEL == 4 GOTO VIRUS_FOUND
IF ERRORLEVEL == 5 GOTO VIRUS_FOUND
GOTO ENDE
:virus_found
echo virus_found> %pcbdrive%%pcbdir%\work\pcbfail.txt
REM *** 4DOS's Move file Command
rem MOVE %1 C:\BAD.VIR
REM *** DOS's Move File Command
MOVE /Y %1 C:\BAD.VIR
:ende
REM *** 4DOS'S REMOVE WORK DIRECTORY COMMAND
rem IF EXIST C:\TEMP%PCBNODE%\*.* DEL C:\TEMP%PCBNODE% /Y/S/X
REM *** DOS REMOVE WORK DIRECTORY COMMAND
IF EXIST C:\TEMP%PCBNODE%\*.* DELTREE /Y C:\TEMP%PCBNODE%
goto end
:DUP
REM If you are running a unregistered version of ZDCS then it would be best
REM to change to the SUB where ZDCS is this way it will not read PCBOARD.SYS
REM So that it will not DISPLAY the 3 or 4 lines of UNREGISTERED stuff to the
REM User's and push the screen up, The only bad thing about this is
REM If you have some user's in the ZDCS.PUL file they will not be found!!
REM C:
REM CD\ZDCS
REM ZDCSFC %1 UPLOAD
REM copy zdcsfc.out %pcbdrive%%pcbdir%
REM IF ERRORLEVEL == 2 type zdcsfc.out>%pcbdrive%%pcbdir%\work\pcbfail.txt
REM IF ERRORLEVEL == 2 move %1 c:\dupe /q
REM IF ERRORLEVEL == 3 type zdcsfc.out>%pcbdrive%%pcbdir%\work\pcbfail.txt
REM IF ERRORLEVEL == 3 move %1 c:\DUPE /q
REM CD %PCBDIR%
REM **** REGISTERED VERSION Can be setup this way!!!! ***********
if exist %1 c:\zdcs\zdcSFC %1 UPLOAD
IF ERRORLEVEL == 2 type zdcsfc.out>%pcbdrive%%pcbdir%\work\pcbfail.txt
IF ERRORLEVEL == 2 move %1 c:\dupe /q
IF ERRORLEVEL == 3 type zdcsfc.out>%pcbdrive%%pcbdir%\work\pcbfail.txt
IF ERRORLEVEL == 3 move %1 c:\DUPE /q
GOTO END
:ADS
REM *** 4DOS'S FILE FILE EXTENTION
rem if %@ext[%1]==zip goto zp2
rem if %@ext[%1]==lzh goto lzh1
rem if %@ext[%1]==arj goto arj1
REM *** DOS'S FIND FILE EXTENTION
testfile %1 LZH ARJ ZIP
REM IF ERRORLEVEL 4 GOTO END
IF ERRORLEVEL == 3 GOTO ZIP1
IF ERRORLEVEL == 2 GOTO ARJ1
IF ERRORLEVEL == 1 GOTO LZH1
GOTO END
:zp2
REM ****** Below the next 13 lines only WORKS with 4DOS ********************
if exist c:\anti%PCBNODE% C:\UTIL\PKZIP {d %1 @C:\ANTI%PCBNODE%
REM *** This is where I create a file to insert in a ZIp Archive *********
REM *** With the File Name Changed to the Time & Date *******************
REM *** This along with the Echoing of the Current Date and Time *********
REM *** Of the Upload will keep other Boards From Removing ***************
REM *** These ads with a 32 bit CRC checker or by FileName ***************
REM *** Also this will only work when USING 4DOS
COPY C:\PCB\LEGAL.ALL C:\
echo This File was Uploaded to THT at %_time on %_date>>c:\legal.all
STAMP C:\LEGAL.ALL 01-01-1980 00:00:00 >NUL
DEL c:\- \*.NFO
MOVE C:\LEGAL.ALL C:\- \%@date[%_date]%@time[%_time].NFO
goto zip1
:arj1
goto end
:lzh1
goto end
:zip1
REM *** Now that the file has been created We use PKZIP with *************
REM *** A changed command line to add these file's to the Archive ********
REM *** Use the PKZIP.CFG to change the "-" to another Character *********
REM *** This will allow you to ad files with the first Character *********
REM *** of "-" or even a Subdirectory ***********************************
if exist %1 C:\UTIL\PKZIP {A {P {r %1 c:\- \*.* >NUL
GOTO END
:REC
RECOM -s C:\PCB\UPCHK\UPCHK.CM%PCBNODE% %1 >NUL
GOTO END
:ADDIZ
REM *** 4DOS'S FILE FILE EXTENTION
REM if %@ext[%1]==zip goto zip3
REM if %@ext[%1]==lzh goto lzh3
REM if %@ext[%1]==arj goto arj3
REM *** DOS'S FIND FILE EXTENTION
testfile %1 LZH ARJ ZIP
REM IF ERRORLEVEL 4 GOTO END
IF ERRORLEVEL == 3 GOTO ZIP3
IF ERRORLEVEL == 2 GOTO ARJ3
IF ERRORLEVEL == 1 GOTO LZH3
GOTO END
:zip3
COPY C:\PCB\UPCHK\FILE_ID.TMP C:\FILE_ID.DIZ
PKZIP -M %1 C:\FILE_ID.DIZ
GOTO END
:arj3
COPY C:\PCB\UPCHK\FILE_ID.TMP C:\FILE_ID.DIZ
ARJ A %1 C:\FILE_ID.DIZ
DEL C:\FILE_ID.DIZ
GOTO END
:lzh3
COPY C:\PCB\UPCHK\FILE_ID.TMP C:\FILE_ID.DIZ
LHA A %1 C:\FILE_ID.DIZ
DEL C:\FILE_ID.DIZ
GOTO END
:END