Advertisement
GlobalAccessSoftware

get_wipe_prefs.bat

Jul 4th, 2022
782
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. :::::::::::::::::::::::::::::::::::::::::::::
  2. :: Ran every time copies-backup is called. ::
  3. :::::::::::::::::::::::::::::::::::::::::::::
  4. set vers=7.8.9.98 20220625010327 by -JpE-
  5. :::::::::::::::::::::::::::::::::::::::::::::
  6. title %ttl1%  [Get Wipe Prefs] %ttl2%
  7. set /a local1=0
  8. set /a rural1=0
  9. set /a extern=0
  10. set /a wipe=0
  11.  
  12. if exist "H:\" set /a extern=1
  13. if exist "X:\" set /a extern+=2
  14. :: NOTE: extern= (1 is just  H, 2 is just X, 3 is both.)
  15.  
  16. :: rev93 introduces the r3v3rs3 var and replaces
  17. :: recovery modules with the mods to copies & get modules.
  18. echo          version: v%vers%
  19. echo .
  20. echo     ***  Processing: %oper%  ***
  21. echo .
  22. if %r3v3rs3% equ 2 set /a extern=0
  23. if %r3v3rs3% equ 2 goto ifrestore
  24.  
  25. if %extern% equ 0 echo %sl%
  26. if %extern% equ 0 echo           **** No EXTERNAL Drives are Online. ****
  27. if %extern% equ 0 echo %sl%
  28. if %extern% equ 0 echo .
  29.  
  30. :ifrestore
  31. set txt="Backups"
  32. if %r3v3rs3% equ 2 set txt="RESTORE"
  33. set msg="==> Wipe Destination for [ Local ] %txt%? (y/N/c): "
  34. choice /c ync /n /t 9 /d n /m %msg%
  35. if %errorlevel% equ 3 goto cancel
  36. set /a local1=%errorlevel%
  37. :: local1 is now either: 1==y or 2==n
  38. echo .
  39. if %extern% equ 0 goto calc
  40. :: No choices here, move along, move along...
  41. echo %l1%
  42. echo .
  43. echo     ***  Processing: %oper%  ***
  44. echo .
  45. ::
  46. set msg="Wipe Destinations for [ External ] Backups? (y/N/c): "
  47. choice /c ync /n /t 14 /d n /m %msg%
  48. if %errorlevel% equ 3 goto cancel
  49. set /a rural1=%errorlevel%
  50. :: rural1 is now either: 1==y or 2==n, 0 if no externals.
  51. echo .
  52.  
  53. :calc
  54. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  55. :: NOTE: [choices] for Wipe, defaults to 2 == no; BE CAREFUL!::
  56. :: 0 == Neither; 1 == Local Only; 2 == Rural Only,           ::
  57. :: 3 == Both, 4 == Cancel. Each is either 1 or 2 ONLY.       ::
  58. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  59. :: NOTE: :: Rev8888 introduces var; RE: extern
  60. :: if %extern% equ 0 set /a rural1=0 is implicite Yes?
  61. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  62. if %local1% equ 1 set /a wipe=1
  63. if %rural1% equ 1 set /a wipe=2
  64. if %local1% equ 1 if %rural1% equ 1 set /a wipe=3
  65. :: Yes, yes it is implied above, when 2nd choice gets skipped.
  66. goto return
  67.  
  68. :cancel
  69. set /a wipe=4
  70. set /a exit2=4
  71.  
  72. :return
  73. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  74. :: DOCS for repeated uses:
  75. :: if cancel (Wipe==4) it's handled already;
  76. :: if neither it passes through with Wipe==0;
  77. :: if wipe==1 just do local,
  78. :: if wipe==2 just do rural, if 3 do both.
  79. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  80.  
  81.  
  82. :: 100% -JpE-
  83.  
  84.  
  85.  
  86.  
Advertisement
RAW Paste Data Copied
Advertisement