home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / sprd.zip / spread.cmd < prev   
OS/2 REXX Batch file  |  1995-04-12  |  1KB  |  36 lines

  1. /* Find all zipfiles in this directory */
  2. if RxFuncQuery('SysLoadFuncs') THEN
  3. do
  4.   /*-- load the load-function --*/
  5.   CALL RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  6.   /*-- load the Sys* utilities --*/
  7.   CALL SysLoadFuncs
  8. end
  9.  
  10. if 0 < arg() then
  11. do
  12. say "This program will find all zip files with the Archieve attribute set,"
  13. say "   create a subdirectory with the name of the zip file, move the"
  14. say "   zip file to that subdirectory, unzip the file, clear the Archieve bit"
  15. say "   and move the zip file back to the original directory."
  16. say ""
  17. say "This program assumes REXX is installed and unzip.exe is on the path or in"
  18. say "   the directory where spread.cmd is being run."
  19. return
  20. end
  21.  
  22.  call SysFileTree '*.zip', 'file', 'FO','+****'
  23.  do i=1 to file.0
  24.    file.i = translate(file.i,'  ','.\')
  25.    x = words(file.i)
  26.    file.i = word(file.i,x-1)
  27.    say file.i
  28.    '@md 'file.i
  29.    '@cd 'file.i
  30.    '@move ..\'file.i'.ZIP .'
  31.    '@unzip 'file.i
  32.    '@attrib 'file.i'.zip -a'
  33.    '@move 'file.i'.ZIP ..'
  34.    '@cd ..'
  35.  end
  36.