home *** CD-ROM | disk | FTP | other *** search
/ Carsten's PPE Collection / Carstens_PPE_Collection_2007.zip / T / THTCK21.ZIP / UPCHK.BAT < prev    next >
DOS Batch File  |  1994-07-06  |  9KB  |  304 lines

  1. @ECHO OFF
  2. IF %2 == UNZ GOTO UNZ
  3. IF %2 == VIRUS GOTO VIRUS
  4. IF %2 == DUP GOTO DUP
  5. IF %2 == ADS GOTO ADS
  6. IF %2 == REC GOTO REC
  7. IF %2 == ADDIZ GOTO ADDIZ
  8. GOTO END
  9.  
  10. :UNZ
  11.  
  12. REM MSDos 6.0+ Command to remove Work Directory
  13. IF EXIST C:\TEMP%PCBNODE%\*.* DELTREE /Y C:\TEMP%PCBNODE%
  14.  
  15.  
  16. REM 4DOS Command to delete all file's in TEMP Work Directory
  17. rem IF EXIST C:\TEMP%PCBNODE%\*.* DEL C:\TEMP%PCBNODE% /Y/S/X 
  18.  
  19.  
  20. :MKDIR
  21. REM  ***  I am useing DRIVE "C" for My work drive make sure you edit this
  22. IF NOT EXIST C:\TEMP%PCBNODE% MD C:\TEMP%PCBNODE%
  23. REM 4DOS Find File Extention
  24. rem if %@ext[%1]==zip goto zip
  25. rem if %@ext[%1]==lzh goto lzh
  26. rem if %@ext[%1]==arj goto arj
  27.  
  28. REM *** If you are running straight DOS then use these lines below
  29. REM DOS'S FIND FILE EXTENTION
  30.  
  31. testfile %1 LZH ARJ ZIP
  32. IF ERRORLEVEL == 3 GOTO ZIP
  33. IF ERRORLEVEL == 2 GOTO ARJ
  34. IF ERRORLEVEL == 1 GOTO LZH
  35.  
  36. goto end
  37.  
  38.  
  39. :ZIP
  40. rem ■ ZIP archive detected
  41. REM *** STRIP AUTHENTIC VERIFICATION ***
  42. STRIPAV -p %1 >NUL
  43.  
  44. REM *** CHECK ZIP FOR CRC ERRORS ***
  45. pkunzip %1 -d C:\TEMP%PCBNODE% 
  46. IF ERRORLEVEL == 50 GOTO ZIP_ERROR
  47. IF ERRORLEVEL == 8 GOTO ZIP_ERROR
  48. IF ERRORLEVEL == 2 GOTO ZIP_ERROR
  49. IF ERRORLEVEL == 1 GOTO ZIP_ERROR
  50.  
  51. REM *** I RUN Antiad to remove BBS ADS if you don't then REM out the next
  52. REM *** Three Lines and put your pkzip -d %1 @file.lst command in
  53.  
  54. C:\PCB\ANTI\antiad.exe -cC:\PCB\ANTI\antiad.cfg -pC:\TEMP%PCBNODE%\  -LC:\ANTI%PCBNODE% 
  55. IF EXIST C:\ANTI%PCBNODE% c:\util\pkzip {d %1 @C:\ANTI%PCBNODE%
  56. IF EXIST C:\ANTI%PCBNODE% DEL C:\ANTI%PCBNODE% 
  57.  
  58. REM  ************************************************************************
  59. REM  **** The line Below is REQUIRED FOR AGE CHECKING!!!!!  *****************
  60. FV.COM  %1 >%PCBDRIVE%%PCBDIR%\filelist.arc
  61. REM  ************************************************************************
  62. REM  **** The line Below is REQUIRED FOR DIZ insertion!!!!!  ****************
  63. IF EXIST C:\TEMP%PCBNODE%\FILE_ID.DIZ COPY C:\TEMP%PCBNODE%\FILE_ID.DIZ %PCBDRIVE%%PCBDIR%\DIZ.%PCBNODE% 
  64.  
  65. IF EXIST C:\TEMP%PCBNODE%\*.ZIP MD C:\TEMP%PCBNODE%\TEMP%PCBNODE%
  66. IF EXIST C:\TEMP%PCBNODE%\*.ZIP pkunzip -d -o C:\TEMP%PCBNODE%\*.ZIP C:\TEMP%PCBNODE%\TEMP\%PCBNODE% 
  67. IF ERRORLEVEL == 50 GOTO ZIP_ERROR
  68. IF ERRORLEVEL == 8 GOTO ZIP_ERROR
  69. IF ERRORLEVEL == 2 GOTO ZIP_ERROR
  70. IF ERRORLEVEL == 1 GOTO ZIP_ERROR
  71. goto end
  72.  
  73. :ARJ
  74. REM  ■ ARJ archive detected
  75. REM  ************************************************************************
  76. REM  **** The line Below is REQUIRED FOR AGE CHECKING!!!!!  *****************
  77. FV.COM %1 >%PCBDRIVE%%PCBDIR%\filelist.arc
  78. arj x -x@exclude.lst %1 C:\TEMP%PCBNODE% >NUL
  79. IF ERRORLEVEL == goto ZIP_ERROR
  80. if errorlevel == 1 goto ZIP_ERROR
  81. REM  ************************************************************************
  82. REM  **** The line Below is REQUIRED FOR DIZ insertion!!!!!  ****************
  83. IF EXIST C:\TEMP%PCBNODE%\FILE_ID.DIZ COPY C:\TEMP%PCBNODE%\FILE_ID.DIZ %PCBDRIVE%%PCBDIR%\DIZ.%PCBNODE% 
  84. goto end
  85.  
  86. :LZH
  87. REM  ■ LHA archive detected
  88. REM  ************************************************************************
  89. REM  **** The line Below is REQUIRED FOR AGE CHECKING!!!!!  *****************
  90. FV.COM %1 >%PCBDRIVE%%PCBDIR%\filelist.arc
  91. lha x %1 C:\TEMP%PCBNODE%\ >NUL
  92. if errorlevel == 1 goto ZIP_ERROR
  93. REM  ************************************************************************
  94. REM  **** The line Below is REQUIRED FOR DIZ insertion!!!!!  ****************
  95. IF EXIST C:\TEMP%PCBNODE%\FILE_ID.DIZ COPY C:\TEMP%PCBNODE%\FILE_ID.DIZ %PCBDRIVE%%PCBDIR%\DIZ.%PCBNODE% 
  96. GOTO END_PROGRAM
  97.  
  98. :ZIP_ERROR
  99. REM MSDos 6.0+ Command to remove Work Directory
  100. IF EXIST C:\TEMP%PCBNODE%\*.* DELTREE /Y C:\TEMP%PCBNODE%
  101.  
  102.  
  103. REM 4DOS Command to delete all file's in TEMP Work Directory
  104. rem IF EXIST C:\TEMP%PCBNODE%\*.* DEL C:\TEMP%PCBNODE% /Y/S/X 
  105.  
  106. REM  ■ CRC ERROR!
  107. ECHO FAILED TESTS: ARCHIVE CONTAINS ERRORS >%PCBDRIVE%%PCBDIR%\WORK\PCBFAIL.TXT 
  108. REM 4DOS MOVE COMMAND
  109. rem MOVE %1 C:\bad.dir 
  110.  
  111. REM DOS'S MOVE COMMAND
  112. MOVE /Y %1 C:\bad.dir
  113. GOTO END
  114.  
  115. rem *** REJECT FALSE FORMAT (LHA/ARJ) ***********************************
  116. :INVALID
  117. REM  ■ LHA OR ARJ
  118. ECHO FAILED TESTS: INVALID ARCHIVE (ARJ OR LHA) >%PCBDRIVE%%PCBDIR%\WORK\PCBFAIL.TXT 
  119. GOTO END
  120.  
  121. :VIRUS
  122.  
  123. if exist %PCBDRIVE%%PCBDIR%\FILELIST.ARC DEL %PCBDRIVE%%PCBDIR%\FILELIST.ARC 
  124. REM 4DOS Find File Extention
  125. rem if %@ext[%1]==zip goto scan
  126. rem if %@ext[%1]==lzh goto scan
  127. rem if %@ext[%1]==arj goto scan
  128.  
  129. REM *** If you are running straight DOS then use these lines below
  130. REM DOS'S FIND FILE EXTENTION
  131. testfile %1 LZH ARJ ZIP
  132. IF ERRORLEVEL == 3 GOTO scan
  133. IF ERRORLEVEL == 2 GOTO scan
  134. IF ERRORLEVEL == 1 GOTO scan
  135.  
  136. goto scan1
  137.  
  138.  
  139. :SCAN
  140. REM ***  McAfee SCAN
  141. REM SCAN C:\TEMP%PCBNODE%\*.* /NOMEM /NOPAUSE /NOEXPIRE /A
  142. REM IF ERRORLEVEL == 1 GOTO VIRUS_FOUND
  143.  
  144. REM  ****  F-PROT
  145. REM F-PROT C:\TEMP%PCBNODE% /NOMEM /ALL /NOBOOT
  146. REM IF ERRORLEVEL == 1 GOTO VIRUS_FOUND
  147.  
  148.  
  149. REM *** Scanning for Virus's ***
  150. TBSCAN C:\TEMP%PCBNODE% af in se co nb nm nh ba II=4  >nul
  151. IF ERRORLEVEL == 4 GOTO VIRUS_FOUND
  152. IF ERRORLEVEL == 5 GOTO VIRUS_FOUND
  153. GOTO ENDE
  154.  
  155.  
  156. :scan1
  157. REM ***  McAfee SCAN
  158. REM SCAN %1 /NOMEM /NOPAUSE /NOEXPIRE /A
  159. REM IF ERRORLEVEL == 1 GOTO VIRUS_FOUND
  160.  
  161. REM  ****  F-PROT
  162. REM F-PROT %1 /NOMEM /ALL /NOBOOT
  163. REM IF ERRORLEVEL == 1 GOTO VIRUS_FOUND
  164.  
  165.  
  166. REM *** Scanning for Virus's ***
  167. TBSCAN %1 af in se co nb nm nh ba II=4  >nul
  168. IF ERRORLEVEL == 4 GOTO VIRUS_FOUND
  169. IF ERRORLEVEL == 5 GOTO VIRUS_FOUND
  170. GOTO ENDE
  171.  
  172.  
  173. :virus_found
  174. echo virus_found> %pcbdrive%%pcbdir%\work\pcbfail.txt
  175. REM *** 4DOS's Move file Command
  176. rem MOVE %1 C:\BAD.VIR 
  177.  
  178. REM ***  DOS's Move File Command
  179. MOVE /Y %1 C:\BAD.VIR 
  180.  
  181. :ende
  182. REM ***  4DOS'S REMOVE WORK DIRECTORY COMMAND
  183. rem IF EXIST C:\TEMP%PCBNODE%\*.* DEL C:\TEMP%PCBNODE% /Y/S/X 
  184.  
  185. REM *** DOS REMOVE WORK DIRECTORY COMMAND
  186. IF EXIST C:\TEMP%PCBNODE%\*.* DELTREE /Y C:\TEMP%PCBNODE%
  187.  
  188. goto end
  189.  
  190. :DUP
  191.  
  192. REM  If you are running a unregistered version of ZDCS then it would be best
  193. REM  to change to the SUB where ZDCS is this way it will not read PCBOARD.SYS
  194. REM  So that it will not DISPLAY the 3 or 4 lines of UNREGISTERED stuff to the
  195. REM  User's and push the screen up, The only bad thing about this is
  196. REM  If you have some user's in the ZDCS.PUL file they will not be found!!
  197. REM C:
  198. REM CD\ZDCS
  199. REM ZDCSFC %1 UPLOAD
  200. REM copy zdcsfc.out %pcbdrive%%pcbdir%
  201. REM IF ERRORLEVEL == 2 type zdcsfc.out>%pcbdrive%%pcbdir%\work\pcbfail.txt
  202. REM IF ERRORLEVEL == 2 move %1 c:\dupe /q
  203. REM IF ERRORLEVEL == 3 type zdcsfc.out>%pcbdrive%%pcbdir%\work\pcbfail.txt
  204. REM IF ERRORLEVEL == 3 move %1 c:\DUPE /q
  205. REM CD %PCBDIR%
  206.  
  207. REM  ****  REGISTERED VERSION Can be setup this way!!!!  ***********
  208. if exist %1 c:\zdcs\zdcSFC %1 UPLOAD
  209. IF ERRORLEVEL == 2 type zdcsfc.out>%pcbdrive%%pcbdir%\work\pcbfail.txt
  210. IF ERRORLEVEL == 2 move %1 c:\dupe /q
  211. IF ERRORLEVEL == 3 type zdcsfc.out>%pcbdrive%%pcbdir%\work\pcbfail.txt
  212. IF ERRORLEVEL == 3 move %1 c:\DUPE /q
  213.  
  214. GOTO END
  215.  
  216.  
  217. :ADS
  218. REM *** 4DOS'S FILE FILE EXTENTION
  219. rem if %@ext[%1]==zip goto zp2
  220. rem if %@ext[%1]==lzh goto lzh1
  221. rem if %@ext[%1]==arj goto arj1
  222.  
  223. REM *** DOS'S FIND FILE EXTENTION
  224.  
  225. testfile %1 LZH ARJ ZIP
  226. REM IF ERRORLEVEL 4 GOTO END
  227. IF ERRORLEVEL == 3 GOTO ZIP1
  228. IF ERRORLEVEL == 2 GOTO ARJ1
  229. IF ERRORLEVEL == 1 GOTO LZH1
  230. GOTO END
  231.  
  232. :zp2
  233. REM ****** Below the next 13 lines only WORKS with 4DOS ********************
  234.  
  235. if exist c:\anti%PCBNODE% C:\UTIL\PKZIP {d %1 @C:\ANTI%PCBNODE%
  236. REM  ***  This is where I create a file to insert in a ZIp Archive *********
  237. REM  ***  With the File Name Changed to the Time & Date  *******************
  238. REM  ***  This along with the Echoing of the Current Date and Time *********
  239. REM  ***  Of the Upload will keep other Boards From Removing ***************
  240. REM  ***  These ads with a 32 bit CRC checker or by FileName ***************
  241. REM  ***  Also this will only work when USING 4DOS
  242. COPY C:\PCB\LEGAL.ALL C:\ 
  243. echo           This File was Uploaded to THT at %_time on %_date>>c:\legal.all
  244. STAMP C:\LEGAL.ALL 01-01-1980 00:00:00 >NUL
  245. DEL c:\- \*.NFO 
  246. MOVE C:\LEGAL.ALL C:\- \%@date[%_date]%@time[%_time].NFO 
  247. goto zip1
  248.  
  249.  
  250. :arj1
  251. goto end
  252. :lzh1
  253. goto end
  254.  
  255. :zip1
  256. REM  ***  Now that the file has been created We use PKZIP with *************
  257. REM  ***  A changed command line to add these file's to the Archive ********
  258. REM  ***  Use the PKZIP.CFG to change the "-" to another Character *********
  259. REM  ***  This will allow you to ad files with the first Character *********
  260. REM  ***  of "-" or even a Subdirectory  ***********************************
  261.  
  262. if exist %1 C:\UTIL\PKZIP {A {P {r %1 c:\- \*.* >NUL
  263. GOTO END
  264.  
  265. :REC
  266. RECOM -s C:\PCB\UPCHK\UPCHK.CM%PCBNODE% %1 >NUL
  267. GOTO END
  268.  
  269. :ADDIZ
  270. REM *** 4DOS'S FILE FILE EXTENTION
  271. REM if %@ext[%1]==zip goto zip3
  272. REM if %@ext[%1]==lzh goto lzh3
  273. REM if %@ext[%1]==arj goto arj3
  274.  
  275. REM *** DOS'S FIND FILE EXTENTION
  276.  
  277.  
  278. testfile %1 LZH ARJ ZIP
  279. REM IF ERRORLEVEL 4 GOTO END
  280. IF ERRORLEVEL == 3 GOTO ZIP3
  281. IF ERRORLEVEL == 2 GOTO ARJ3
  282. IF ERRORLEVEL == 1 GOTO LZH3
  283. GOTO END
  284.  
  285. :zip3
  286. COPY C:\PCB\UPCHK\FILE_ID.TMP C:\FILE_ID.DIZ
  287. PKZIP -M %1 C:\FILE_ID.DIZ
  288. GOTO END
  289.  
  290. :arj3
  291. COPY C:\PCB\UPCHK\FILE_ID.TMP C:\FILE_ID.DIZ
  292. ARJ A %1 C:\FILE_ID.DIZ
  293. DEL C:\FILE_ID.DIZ
  294. GOTO END
  295.  
  296. :lzh3
  297. COPY C:\PCB\UPCHK\FILE_ID.TMP C:\FILE_ID.DIZ
  298. LHA A %1 C:\FILE_ID.DIZ
  299. DEL C:\FILE_ID.DIZ
  300. GOTO END
  301.  
  302. :END
  303.  
  304.