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