home *** CD-ROM | disk | FTP | other *** search
/ Carsten's PPE Collection / Carstens_PPE_Collection_2007.zip / T / THTC25B1.ZIP / UPCHK.BAT < prev    next >
DOS Batch File  |  1995-01-03  |  10KB  |  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. IF %2 == DELTEMP GOTO ENDE
  9.  
  10.  
  11. GOTO END
  12.  
  13. :UNZ
  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. REM C:\PCB\ANTI\antiad.exe -cC:\PCB\ANTI\antiad.cfg -pC:\TEMP%PCBNODE%\  -LC:\ANTI%PCBNODE% 
  57. REM IF EXIST C:\ANTI%PCBNODE% c:\util\pkzip {d %1 @C:\ANTI%PCBNODE%
  58. REM IF EXIST C:\ANTI%PCBNODE% DEL C:\ANTI%PCBNODE% 
  59.  
  60. REM  ************************************************************************
  61. REM  **** The line Below is REQUIRED FOR AGE CHECKING!!!!!  *****************
  62. REM DIR C:\TEMP%PCBNODE%\ /FHES>FILEARC.LST 4dos DIR command
  63. DIR C:\TEMP%PCBNODE%\ /S/B>FILEARC.LST
  64. REM  ************************************************************************
  65. REM  **** The line Below is REQUIRED FOR DIZ insertion!!!!!  ****************
  66. IF EXIST C:\TEMP%PCBNODE%\FILE_ID.DIZ COPY C:\TEMP%PCBNODE%\FILE_ID.DIZ %PCBDRIVE%%PCBDIR%\DIZ.%PCBNODE% 
  67.  
  68. IF EXIST C:\TEMP%PCBNODE%\*.ZIP MD C:\TEMP%PCBNODE%\TEMP%PCBNODE%
  69. IF EXIST C:\TEMP%PCBNODE%\*.ZIP pkunzip -d -o C:\TEMP%PCBNODE%\*.ZIP C:\TEMP%PCBNODE%\TEMP\%PCBNODE% 
  70. IF ERRORLEVEL == 50 GOTO ZIP_ERROR
  71. IF ERRORLEVEL == 8 GOTO ZIP_ERROR
  72. IF ERRORLEVEL == 2 GOTO ZIP_ERROR
  73. IF ERRORLEVEL == 1 GOTO ZIP_ERROR
  74. goto end
  75.  
  76. :ARJ
  77. REM  ■ ARJ archive detected
  78. REM  ************************************************************************
  79. REM  **** The line Below is REQUIRED FOR AGE CHECKING!!!!!  *****************
  80. REM DIR C:\TEMP%PCBNODE%\ /FHES>FILEARC.LST 4dos DIR command
  81. DIR C:\TEMP%PCBNODE%\ /S/B>FILEARC.LST
  82. arj x -x@exclude.lst %1 C:\TEMP%PCBNODE% >NUL
  83. IF ERRORLEVEL == goto ZIP_ERROR
  84. if errorlevel == 1 goto ZIP_ERROR
  85. REM  ************************************************************************
  86. REM  **** The line Below is REQUIRED FOR DIZ insertion!!!!!  ****************
  87. IF EXIST C:\TEMP%PCBNODE%\FILE_ID.DIZ COPY C:\TEMP%PCBNODE%\FILE_ID.DIZ %PCBDRIVE%%PCBDIR%\DIZ.%PCBNODE% 
  88. goto end
  89.  
  90. :LZH
  91. REM  ■ LHA archive detected
  92. REM  ************************************************************************
  93. REM  **** The line Below is REQUIRED FOR AGE CHECKING!!!!!  *****************
  94. REM DIR C:\TEMP%PCBNODE%\ /FHES>FILEARC.LST 4dos DIR command
  95. DIR C:\TEMP%PCBNODE%\ /S/B>FILEARC.LST
  96. lha x %1 C:\TEMP%PCBNODE%\ >NUL
  97. if errorlevel == 1 goto ZIP_ERROR
  98. REM  ************************************************************************
  99. REM  **** The line Below is REQUIRED FOR DIZ insertion!!!!!  ****************
  100. IF EXIST C:\TEMP%PCBNODE%\FILE_ID.DIZ COPY C:\TEMP%PCBNODE%\FILE_ID.DIZ %PCBDRIVE%%PCBDIR%\DIZ.%PCBNODE% 
  101. GOTO END_PROGRAM
  102.  
  103. :ZIP_ERROR
  104. REM MSDos 6.0+ Command to remove Work Directory
  105. IF EXIST C:\TEMP%PCBNODE%\*.* DELTREE /Y C:\TEMP%PCBNODE%
  106.  
  107.  
  108. REM 4DOS Command to delete all file's in TEMP Work Directory
  109. rem IF EXIST C:\TEMP%PCBNODE%\*.* DEL C:\TEMP%PCBNODE% /Y/S/X 
  110.  
  111. REM  ■ CRC ERROR!
  112. ECHO FAILED TESTS: ARCHIVE CONTAINS ERRORS >%PCBDRIVE%%PCBDIR%\WORK\PCBFAIL.TXT 
  113. REM 4DOS MOVE COMMAND
  114. rem MOVE %1 C:\bad.dir 
  115.  
  116. REM DOS'S MOVE COMMAND
  117. MOVE /Y %1 C:\bad.dir
  118. GOTO END
  119.  
  120. rem *** REJECT FALSE FORMAT (LHA/ARJ) ***********************************
  121. :INVALID
  122. REM  ■ LHA OR ARJ
  123. ECHO FAILED TESTS: INVALID ARCHIVE (ARJ OR LHA) >%PCBDRIVE%%PCBDIR%\WORK\PCBFAIL.TXT 
  124. GOTO END
  125.  
  126. :VIRUS
  127.  
  128. if exist %PCBDRIVE%%PCBDIR%\FILELIST.ARC DEL %PCBDRIVE%%PCBDIR%\FILELIST.ARC 
  129. REM 4DOS Find File Extention
  130. rem if %@ext[%1]==zip goto scan
  131. rem if %@ext[%1]==lzh goto scan
  132. rem if %@ext[%1]==arj goto scan
  133.  
  134. REM *** If you are running straight DOS then use these lines below
  135. REM DOS'S FIND FILE EXTENTION
  136. testfile %1 LZH ARJ ZIP
  137. IF ERRORLEVEL == 3 GOTO scan
  138. IF ERRORLEVEL == 2 GOTO scan
  139. IF ERRORLEVEL == 1 GOTO scan
  140.  
  141. goto scan1
  142.  
  143.  
  144. :SCAN
  145. REM ***  McAfee SCAN
  146. REM SCAN C:\TEMP%PCBNODE%\*.* /NOMEM /NOPAUSE /NOEXPIRE /A
  147. REM IF ERRORLEVEL == 1 GOTO VIRUS_FOUND
  148.  
  149. REM  ****  F-PROT
  150. REM F-PROT C:\TEMP%PCBNODE% /NOMEM /ALL /NOBOOT
  151. REM IF ERRORLEVEL == 1 GOTO VIRUS_FOUND
  152.  
  153.  
  154. REM *** Scanning for Virus's ***
  155. TBSCAN C:\TEMP%PCBNODE% af in se co nb nm nh ba II=4  >nul
  156. IF NOT ERRORLEVEL == 0 GOTO VIRUS_FOUND
  157. GOTO ENDE
  158.  
  159.  
  160. :scan1
  161. REM ***  McAfee SCAN
  162. REM SCAN %1 /NOMEM /NOPAUSE /NOEXPIRE /A
  163. REM IF ERRORLEVEL == 1 GOTO VIRUS_FOUND
  164.  
  165. REM  ****  F-PROT
  166. REM F-PROT %1 /NOMEM /ALL /NOBOOT
  167. REM IF ERRORLEVEL == 1 GOTO VIRUS_FOUND
  168.  
  169.  
  170. REM *** Scanning for Virus's ***
  171. TBSCAN %1 af in se co nb nm nh ba II=4  >nul
  172. IF NOT ERRORLEVEL == 0 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. REM if exist %1 c:\zdcs\zdcSFC %1 UPLOAD
  212. REM IF ERRORLEVEL == 2 type zdcsfc.out>%pcbdrive%%pcbdir%\work\pcbfail.txt
  213. REM IF ERRORLEVEL == 2 move %1 c:\dupe /q
  214. REM IF ERRORLEVEL == 3 type zdcsfc.out>%pcbdrive%%pcbdir%\work\pcbfail.txt
  215. REM 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.