home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / trays09b.zip / backtray.cmd next >
OS/2 REXX Batch file  |  2000-03-20  |  1KB  |  54 lines

  1. /* Rexx Script by SubSyS solutions*/
  2.  
  3. parse arg backupfile
  4.  
  5. say ""
  6. say "BackUpTray for WarpCenter V0.9b by SubSyS "
  7. say ""
  8. If backupfile = "" then signal HELPTXT
  9.  
  10.  
  11. rc = RxFuncAdd('SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs')
  12. call SysLoadFuncs
  13.  
  14. call RxFuncAdd 'WPToolsLoadFuncs', 'WPTOOLS', 'WPToolsLoadFuncs' 
  15. rc = WPToolsLoadFuncs()
  16.  
  17. iRetco = WPToolsQueryObject("<WP_WARPCENTER>",,, "SetupString")
  18. if Iretco Then 
  19.   do
  20.      say 'Writing traysettings to backupfile:' backupfile
  21.  
  22.    startpos = 1
  23.  
  24.    do i = 1 to 100
  25.     adtray_pos.i = pos("ADDTRAY", setupstring, startpos)
  26.     if adtray_pos.i = 0 then leave
  27.     sem_pos.i = pos(";", setupstring, startpos)
  28.     startpos = sem_pos.i + 1
  29.  
  30.   end
  31.  
  32.  
  33.    do a = 1 to i-1
  34.     olen = sem_pos.a - adtray_pos.a
  35.     output = substr(setupstring, adtray_pos.a, olen)
  36.     rc = lineout(backupfile, output)
  37.    end
  38. say "Done!"
  39.  
  40.   end
  41. else
  42.   say 'Unable to return object settings for WarpCenter'
  43.  
  44. exit
  45.  
  46. HELPTXT:
  47.  
  48. say "Usage:"
  49. say " backtray<.cmd> backupfile"
  50. say "  e.g.: backtray C:\backup\wctray01.set"
  51.  
  52.  
  53.  
  54. ENDE: