home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d09xx / d0925.lha / DonsGenies / DonsGenies.lha / Useful / filextractor.rexx next >
OS/2 REXX Batch file  |  1993-07-28  |  1KB  |  33 lines

  1. /* Generic file extractor - Randy C. Finch 1990 
  2.     I typed this in from an article in Amazing Computing. Best way to use it is to copy the archive files to ram: then "cd ram:" and do "rx filextractor". It will find and extract all the archived files in ram: and make the correct directories. Then you can transfer them to disk. It would be easy to add other extraction programs to the set - I have added Lha.  - Don Cox. */
  3.  
  4. trace r
  5.  
  6. address command
  7.  
  8. 'list >ram:rcflist files quick'
  9.  
  10. call open('rcf','ram:rcflist','R')
  11.  
  12. do until eof('rcf')
  13.     filename = readln('rcf')
  14.     rs = right(filename,4)
  15.     rs = upper(right(filename,4))
  16.     if rs = '.ARC' | rs = '.ZOO' | rs = '.LZH' | rs = '.LHA' then do
  17.         ls = left(filename,length(filename)-4)
  18.         'makedir ' ls
  19. /* CD must be inline with command */
  20. /* Current dir of calling shell will not change */
  21.         prefix = 'cd 'ls'0a'x
  22.         select
  23.             when rs = '.ARC' then prefix 'arc x /'ls'.arc'
  24.             when rs = '.ZOO' then prefix 'zoo x /'ls'.zoo'
  25.             when rs = '.LZH' then prefix 'lha -x x /'ls'.lzh'
  26.             when rs = '.LHA' then prefix 'lha -x x /'ls'.lha'
  27.             end
  28.         end
  29.     end
  30.  
  31. call close('rcf')
  32. 'delete ram:rcflist'
  33. exit