home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / UTIL_ARC / QAZ_230.ZIP / QAZ-DEMO.EXE / XQAZ.BAT < prev   
DOS Batch File  |  1994-01-14  |  5KB  |  247 lines

  1. @echo off
  2.  
  3. rem XQAZ.BAT v1.0
  4.  
  5. if exist xqaz.$$$ erase xqaz.$$$
  6.  
  7. if exist %2 goto archive_exists
  8. echo * Error: file not found (%2)
  9. goto usage
  10.  
  11. :archive_exists
  12. set vcmd=v
  13. set ecmd=e
  14. set tcmd=t
  15. set scmd=s
  16. set cmd=%1
  17. if %cmd% == %vcmd%  goto view_archive
  18. if %cmd% == %ecmd% goto identify
  19. if %cmd% == %tcmd% goto identify
  20. if %cmd% == %scmd% goto identify
  21. echo * Error: unrecognized command (%cmd%)
  22. goto usage
  23.  
  24. :view_archive
  25. qaz %2 /f$1vpa /l /u- /b- /w- /v1ut > xqaz.$$$
  26. goto done
  27. rem possible modifications are to add the /r option, and if the archive
  28. rem turns out to be a format which QAZ cannot list (such as UC2), then
  29. rem to call the appropriate viewing function instead (UC2 V %2 %3).
  30.  
  31. :identify
  32. qaz %2 /r /vi /fa$ > xqaz.$$$
  33. if not %cmd% == %scmd% goto check
  34. set scmd=%tcmd%
  35. set cmd=%ecmd%
  36.  
  37. :check
  38. if errorlevel 128 goto graphics
  39. if errorlevel 59 goto xundef
  40. if errorlevel 58 goto xbinhex
  41. if errorlevel 57 goto xlharc
  42. if errorlevel 56 goto xundef
  43. if errorlevel 55 goto xcodec
  44. if errorlevel 54 goto xundef
  45. if errorlevel 53 goto xtar
  46. if errorlevel 52 goto xproprietary
  47. if errorlevel 51 goto xzoo
  48. if errorlevel 50 goto xzip
  49. if errorlevel 49 goto xusq
  50. if errorlevel 48 goto xuc2
  51. if errorlevel 47 goto xsqz
  52. if errorlevel 46 goto xsit
  53. if errorlevel 45 goto xundef
  54. if errorlevel 44 goto xproprietary
  55. if errorlevel 43 goto xlharc
  56. if errorlevel 42 goto xundef
  57. if errorlevel 41 goto xundef
  58. if errorlevel 40 goto xpak
  59. if errorlevel 39 goto xlharc
  60. if errorlevel 38 goto xproprietary
  61. if errorlevel 37 goto xundef
  62. if errorlevel 36 goto xlib
  63. if errorlevel 35 goto xundef
  64. if errorlevel 34 goto xproprietary
  65. if errorlevel 33 goto xwin
  66. if errorlevel 32 goto xhpack
  67. if errorlevel 31 goto xhyp
  68. if errorlevel 30 goto xhap
  69. if errorlevel 29 goto xha
  70. if errorlevel 28 goto xgz
  71. if errorlevel 27 goto xfrz
  72. if errorlevel 26 goto xmsc
  73. if errorlevel 25 goto xdwc
  74. if errorlevel 24 goto xdiet
  75. if errorlevel 23 goto xundef
  76. if errorlevel 22 goto xundef
  77. if errorlevel 21 goto xgz
  78. if errorlevel 20 goto xarj
  79. if errorlevel 19 goto xark
  80. if errorlevel 18 goto xundef
  81. if errorlevel 17 goto xlharc
  82. if errorlevel 16 goto xtext
  83. if errorlevel 15 goto xundef
  84. if errorlevel  1 echo * An error has occurred! >> xqaz.$$$
  85. echo * Unable to identify the archive format.
  86. goto exit
  87.  
  88. :xbinhex
  89. if %1=%scmd% goto untestable
  90. if %1=%tcmd% goto xbhtest
  91. xbin %2 >> xqaz.$$$
  92. :xbhtest
  93. xbin -l %2 >> xqaz.$$$
  94. goto done
  95.  
  96. :xtext
  97. type %2 >> xqaz.$$$
  98. goto done
  99.  
  100. :xundef
  101. echo * Don't know how to process this format! >> xqaz.$$$
  102. goto done
  103.  
  104. :xproprietary
  105. echo * Proprietary format. >> xqaz.$$$
  106. goto xundef
  107.  
  108. :untestable
  109. echo * Testing is not supported by this format. >> xqaz.$$$
  110. goto done
  111.  
  112. :xwin
  113. echo * The archiver for this format requires Windows. >> xqaz.$$$
  114. goto done
  115.  
  116. :xark
  117. arc -%cmd% %2 %3 >> xqaz.$$$
  118. goto done
  119.  
  120. :xarj
  121. arj %cmd% %2 %3 >> xqaz.$$$
  122. goto done
  123.  
  124. :xdiet
  125. if %cmd%==%tcmd% goto untestable
  126. diet -ra %2
  127. goto done
  128.  
  129. :xdwc
  130. dwc -%cmd% %2 %3 >> xqaz.$$$
  131. goto done
  132.  
  133. :xmsc
  134. expand %2
  135. goto done
  136.  
  137. :xfrz
  138. if %cmd%==%tcmd% goto untestable
  139. freeze -%cmd%v %2 >> xqaz.$$$
  140. goto done
  141.  
  142. :xgz
  143. gzip -%cmd%v %2 >> xqaz.$$$
  144. goto done
  145.  
  146. :xha
  147. ha %cmd% %2 %3 >> xqaz.$$$
  148. goto done
  149.  
  150. :xhap
  151. if %cmd%==%tcmd% goto untestable
  152. pah e %2 %3 
  153. goto done
  154.  
  155. :xhyp
  156. if %cmd%==%tcmd% goto untestable
  157. hyper -x %2 %3 >> xqaz.$$$
  158. goto done
  159.  
  160. :xhpack
  161. if %cmd%==%tcmd% goto hpskip
  162. hpack x %2 %3 >> xqaz.$$$
  163. goto done
  164. :hpskip
  165. hpack %cmd% %2 %3 >> xqaz.$$$
  166. goto done
  167.  
  168. :xlib
  169. if %cmd%==%tcmd% goto untestable
  170. lu %cmd% %2 %3 >> xqaz.$$$
  171. goto done
  172.  
  173. :xpak
  174. pak %cmd% %2 3 >> xqaz.$$$
  175. goto done
  176.  
  177. :xsit
  178. unsit %cmd% %2 >> xqaz.$$$
  179. goto done
  180.  
  181. :xsqz
  182. rem doesn't redirect well
  183. sqz %cmd% %2 %3
  184. goto done
  185.  
  186. :xuc2
  187. rem * I don't have a copy of UC.EXE handy...
  188. goto xundef
  189.  
  190. :xusq
  191. if %cmd%==%tcmd% goto untestable
  192. usq %2 >> xqaz.$$$
  193. goto done
  194.  
  195. :xlharc
  196. lha %cmd% %2 %3 >> xqaz.$$$
  197. goto done   
  198.  
  199. :xcodec
  200. if %cmd%==%tcmd% goto tcodec
  201. codec -db %2 %3 >> xqaz.$$$
  202. goto done
  203. :tcodec
  204. codec -x %2 %3 >> xqaz.$$$  
  205. goto done
  206.  
  207. :xtar
  208. if %cmd%==%tcmd% goto untestable
  209. rem doesn't redirect well
  210. tar -xvf %2 %3
  211. goto done
  212.  
  213. :xzoo
  214. zoo -%cmd% %2 %3 >> xqaz.$$$
  215. goto done
  216.  
  217. :xzip
  218. pkunzip -%cmd% %2 %3 >> xqaz.$$$
  219. goto done
  220.  
  221. :graphics
  222. echo * XQAZ doesn't handle graphics files.
  223. goto exit
  224.  
  225. :usage
  226. echo Usage: xqaz [v,e,t,s] archive [datafile]
  227. goto exit
  228.  
  229. :done
  230. if errorlevel 1 echo * An error occurred >> xqaz.$$$
  231. if not %scmd% == %tcmd% goto show
  232.  
  233. :vscan
  234. scan *.* /a /nomem >> xqaz.$$$
  235. rem insert favorite virus scanners here
  236.  
  237. :show
  238. more < xqaz.$$$
  239.  
  240. :exit
  241. set vcmd=
  242. set tcmd=
  243. set ecmd=
  244. set scmd=
  245. if exist xqaz.$$$ erase xqaz.$$$
  246.  
  247.