Advertisement
GlobalAccessSoftware

get_wipe_prefs.bat

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