home *** CD-ROM | disk | FTP | other *** search
/ Carsten's PPE Collection / Carstens_PPE_Collection_2007.zip / T / THTCK140.ZIP / UNZ.BAT < prev    next >
DOS Batch File  |  1994-06-18  |  4KB  |  112 lines

  1. @echo off
  2.  
  3. :del_temp
  4. REM MSDos 6.0+ Command to remove Work Directory
  5. REM IF EXIST C:\TEMP%PCBNODE%\*.* DELTREE /Y C:\TEMP%PCBNODE%
  6.  
  7.  
  8. REM 4DOS Command to delete all file's in TEMP Work Directory
  9. IF EXIST C:\TEMP%PCBNODE%\*.* DEL C:\TEMP%PCBNODE% /Y/S/X 
  10.  
  11.  
  12. :MKDIR
  13. REM  ***  I am useing DRIVE "C" for My work drive make sure you edit this
  14. IF NOT EXIST C:\TEMP%PCBNODE% MD C:\TEMP%PCBNODE%
  15. REM 4DOS Find File Extention
  16. if %@ext[%1]==zip goto zip
  17. if %@ext[%1]==lzh goto lzh
  18. if %@ext[%1]==arj goto arj
  19.  
  20. REM *** If you are running straight DOS then use these lines below
  21. REM DOS'S FIND FILE EXTENTION
  22. REM testfile %1 LZH ARJ ZIP
  23. REM IF ERRORLEVEL 4 GOTO TEST_TXT
  24. REM IF ERRORLEVEL 3 GOTO ZIP
  25. REM IF ERRORLEVEL 2 GOTO ARJ
  26. REM IF ERRORLEVEL 1 GOTO LZH
  27.  
  28. goto end_program
  29.  
  30.  
  31. :ZIP
  32. rem ■ ZIP archive detected
  33. REM *** STRIP AUTHENTIC VERIFICATION ***
  34. STRIPAV -p %1 >NUL
  35.  
  36. REM *** CHECK ZIP FOR CRC ERRORS ***
  37. pkunzip %1 -d C:\TEMP%PCBNODE% 
  38.  
  39. REM *** I RUN Antiad to remove BBS ADS if you don't then REM out the next
  40. REM *** Three Lines and put your pkzip -d %1 @file.lst command in
  41.  
  42. C:\PCB\ANTI\antiad.exe -cC:\PCB\ANTI\antiad.cfg -pC:\TEMP%PCBNODE%\  -LC:\ANTI%PCBNODE% 
  43. IF EXIST C:\ANTI%PCBNODE% c:\util\pkzip {d %1 @C:\ANTI%PCBNODE%
  44. IF EXIST C:\ANTI%PCBNODE% DEL C:\ANTI%PCBNODE% 
  45.  
  46. REM  ************************************************************************
  47. REM  **** The line Below is REQUIRED FOR AGE CHECKING!!!!!  *****************
  48. FV.COM  %1 >%PCBDRIVE%%PCBDIR%\filelist.arc
  49. REM  ************************************************************************
  50. REM  **** The line Below is REQUIRED FOR DIZ insertion!!!!!  ****************
  51. IF EXIST C:\TEMP%PCBNODE%\FILE_ID.DIZ COPY C:\TEMP%PCBNODE%\FILE_ID.DIZ %PCBDRIVE%%PCBDIR%\DIZ.%PCBNODE% 
  52.  
  53. IF EXIST C:\TEMP%PCBNODE%\*.ZIP MD C:\TEMP%PCBNODE%\TEMP%PCBNODE%
  54. IF EXIST C:\TEMP%PCBNODE%\*.ZIP pkunzip -d -o C:\TEMP%PCBNODE%\*.ZIP C:\TEMP%PCBNODE%\TEMP\%PCBNODE% 
  55. IF ERRORLEVEL == 50 GOTO ZIP_ERROR
  56. IF ERRORLEVEL == 8 GOTO ZIP_ERROR
  57. IF ERRORLEVEL == 2 GOTO ZIP_ERROR
  58. IF ERRORLEVEL == 1 GOTO ZIP_ERROR
  59. goto end_program
  60.  
  61. :ARJ
  62. REM  ■ ARJ archive detected
  63. REM  ************************************************************************
  64. REM  **** The line Below is REQUIRED FOR AGE CHECKING!!!!!  *****************
  65. FV.COM %1 >%PCBDRIVE%%PCBDIR%\filelist.arc
  66. arj x -x@exclude.lst %1 C:\TEMP%PCBNODE% >NUL
  67. IF ERRORLEVEL == goto ZIP_ERROR
  68. if errorlevel == 1 goto ZIP_ERROR
  69. REM  ************************************************************************
  70. REM  **** The line Below is REQUIRED FOR DIZ insertion!!!!!  ****************
  71. IF EXIST C:\TEMP%PCBNODE%\FILE_ID.DIZ COPY C:\TEMP%PCBNODE%\FILE_ID.DIZ %PCBDRIVE%%PCBDIR%\DIZ.%PCBNODE% 
  72. goto end_program
  73.  
  74. :LZH
  75. REM  ■ LHA archive detected
  76. REM  ************************************************************************
  77. REM  **** The line Below is REQUIRED FOR AGE CHECKING!!!!!  *****************
  78. FV.COM %1 >%PCBDRIVE%%PCBDIR%\filelist.arc
  79. lha x %1 C:\TEMP%PCBNODE%\ >NUL
  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_PROGRAM
  85.  
  86. :ZIP_ERROR
  87. REM MSDos 6.0+ Command to remove Work Directory
  88. REM IF EXIST C:\TEMP%PCBNODE%\*.* DELTREE /Y C:\TEMP%PCBNODE%
  89.  
  90.  
  91. REM 4DOS Command to delete all file's in TEMP Work Directory
  92. IF EXIST C:\TEMP%PCBNODE%\*.* DEL C:\TEMP%PCBNODE% /Y/S/X 
  93.  
  94. REM  ■ CRC ERROR!
  95. ECHO FAILED TESTS: ARCHIVE CONTAINS ERRORS >%PCBDRIVE%%PCBDIR%\WORK\PCBFAIL.TXT 
  96. REM 4DOS MOVE COMMAND
  97. MOVE %1 C:\bad.dir 
  98.  
  99. REM DOS'S MOVE COMMAND
  100. REM MOVE /Y %1 C:\bad.dir
  101. GOTO END_program
  102.  
  103. rem *** REJECT FALSE FORMAT (LHA/ARJ) ***********************************
  104. :INVALID
  105. REM  ■ LHA OR ARJ
  106. ECHO FAILED TESTS: INVALID ARCHIVE (ARJ OR LHA) >%PCBDRIVE%%PCBDIR%\WORK\PCBFAIL.TXT 
  107. GOTO END_program
  108.  
  109.  
  110. :end_program
  111.  
  112.