home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / warptape.zip / RXRESEAS.CMD < prev   
OS/2 REXX Batch file  |  1995-02-15  |  3KB  |  119 lines

  1. /* Restore the entire file tree of the disk */
  2.  
  3. CALL RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  4. CALL SysLoadFuncs
  5.  
  6. CALL SysCls
  7.  
  8. SAY " "
  9. SAY " "
  10. SAY "                                WARNING!!!"
  11. SAY " "
  12. SAY "                       All EAs will be overwritten."
  13. SAY " "
  14. SAY "                      Press 'n' or 'N' to Cancel Backup."
  15. SAY " "
  16. SAY "                         Any other key to Continue."
  17.  
  18. CTRPAD = 80
  19.  
  20. HelpCheck = ARG(1)
  21.      if HelpCheck = '' then do
  22.      CALL SysCls
  23.      SAY " "
  24.      SAY " "
  25.      SAY " "
  26.      SAY CENTER('Usage: RXRESEAS [DriveLetter]', CTRPAD)
  27.      SAY " "
  28.      SAY CENTER('For example: RXRESEAS C', CTRPAD)
  29.      SAY ' '
  30.      SAY CENTER('See README.1ST file for more information', CTRPAD)
  31.      SAY ' '
  32.      SAY ' '
  33.      EXIT
  34.     END
  35.  
  36.  
  37. Key = SysGetKey()
  38. If Key = 'N' then DO
  39.      CALL SysCls
  40.      EXIT
  41.      end
  42. If Key = 'n' then DO
  43.      CALL SysCls
  44.      EXIT
  45.      end
  46.  
  47. Select
  48.      when ARG(1) = "c" then
  49.           FromDir = "C:\EAS"
  50.      when ARG(1) = "C" then
  51.           FromDir = "C:\EAS"
  52.      when ARG(1) = "D" then
  53.           FromDir = "D:\EAS"
  54.      when ARG(1) = "d" then
  55.           FromDir = "D:\EAS"
  56.      when ARG(1) = "E" then
  57.           FromDir = "E:\EAS"
  58.      when ARG(1) = "e" then
  59.           FromDir = "E:\EAS"
  60.      when ARG(1) = "F" then
  61.           FromDir = "F:\EAS"
  62.      when ARG(1) = "f" then
  63.           FromDir = "F:\EAS"
  64.      when ARG(1) = "G" then
  65.           FromDir = "G:\EAS"
  66.      when ARG(1) = "g" then
  67.           FromDir = "G:\EAS"
  68.      when ARG(1) = "H" then
  69.           FromDir = "H:\EAS"
  70.      when ARG(1) = "h" then
  71.           FromDir = "H:\EAS"
  72.      when ARG(1) = "I" then
  73.           FromDir = "I:\EAS"
  74.      when ARG(1) = "i" then
  75.           FromDir = "I:\EAS"
  76.      Otherwise
  77.           SAY " "
  78.           SAY " "
  79.           SAY "                          ERROR!"
  80.           SAY " "
  81.           SAY "       Drives beyond I not supported by this version."
  82.      end
  83.  
  84. /* Save current directory and change to [drive]:\temp */ 
  85.  
  86. CurDir = DIRECTORY()
  87. NewDir = DIRECTORY(FromDir)
  88.  
  89. /* Read in the path and file names to restore */
  90.  
  91. DO FOREVER
  92.  
  93.      PathOut = LINEIN(EADIR.LST)
  94.      IF PathOut = "" THEN LEAVE
  95.      ELSE DO
  96.      SlashPos = LASTPOS('\', PathOut)
  97.      WorkDir = DELSTR(PathOut, 1, (SlashPos - 1))
  98.      FileName = INSERT(FromDir, WorkDir)
  99.      EAUTIL Pathout FileName "/O /J /P"
  100.      END
  101. END
  102.  
  103. CALL STREAM EADIR.LST, C, CLOSE
  104.  
  105. CALL DIRECTORY(CurDir)
  106.  
  107. CALL SysCls
  108. SAY " "
  109. SAY " "
  110. SAY "        Press Y to view successfully stored EA Files..."
  111. SAY " "
  112. SAY " "
  113.  
  114. key = SysGetKey(NOECHO)
  115. PARSE UPPER VAR key key
  116. if Key = 'Y' then do
  117.      DIR FromDir
  118. end
  119.