Advertisement
FreeBooter

RegBackup.bat

Oct 26th, 2016
469
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.41 KB | None | 0 0
  1. :: Created By FreeBooter
  2. :: www.dost-tech.com
  3. @Echo Off & Cls
  4. Echo.
  5.  
  6. Call :IsAdmin
  7.  
  8. If Not Exist C:\Registry_Backups (md C:\Registry_Backups) Else (Goto :Skip)
  9. If Not Exist C:\Registry_Backups\RegOld (Md C:\Registry_Backups\RegOld) Else (Goto :Skip)
  10.  
  11. :Skip
  12.  
  13. if exist C:\Registry_Backups\DEFAULT.OLD move /Y C:\Registry_Backups\DEFAULT.OLD C:\Registry_Backups\RegOld
  14. if exist C:\Registry_Backups\SAM.OLD move /Y C:\Registry_Backups\SAM.OLD C:\Registry_Backups\RegOld
  15. if exist C:\Registry_Backups\SECURITY.OLD move /Y C:\Registry_Backups\SECURITY.OLD C:\Registry_Backups\RegOld
  16. if exist C:\Registry_Backups\SOFTWARE.OLD move /Y C:\Registry_Backups\SOFTWARE.OLD C:\Registry_Backups\RegOld
  17. if exist C:\Registry_Backups\SYSTEM.OLD move /Y C:\Registry_Backups\SYSTEM.OLD C:\Registry_Backups\RegOld
  18. if exist C:\Registry_Backups\NTUSER.OLD move /Y C:\Registry_Backups\NTUSER.OLD C:\Registry_Backups\RegOld
  19. if exist C:\Registry_Backups\sessionstore.OLD  move /y C:\Registry_Backups\sessionstore.OLD  C:\Registry_Backups\RegOld
  20.  
  21.  
  22.  
  23.  
  24.  
  25. If Exist C:\Registry_Backups\DEFAULT Ren C:\Registry_Backups\DEFAULT DEFAULT.OLD 2>&1 > Nul
  26. If Exist C:\Registry_Backups\SAM Ren C:\Registry_Backups\SAM  SAM.OLD 2>&1 > Nul
  27. If Exist C:\Registry_Backups\SECURITY Ren C:\Registry_Backups\SECURITY SECURITY.OLD 2>&1 > Nul
  28. If Exist C:\Registry_Backups\SOFTWARE Ren C:\Registry_Backups\SOFTWARE SOFTWARE.OLD 2>&1 > Nul
  29. If Exist C:\Registry_Backups\SYSTEM Ren C:\Registry_Backups\SYSTEM SYSTEM.OLD 2>&1 > Nul
  30. If Exist C:\Registry_Backups\NTUSER.DAT Ren C:\Registry_Backups\NTUSER.DAT NTUSER.OLD 2>&1 > Nul
  31.  
  32.  
  33.  
  34. If %Errorlevel% GTR 0 (
  35. @Echo Set oWshShell = WScript.CreateObject^("WScript.Shell"^) > %Tmp%\Popup.vbs
  36. @Echo oWshShell.Popup "Error Backing Registry Hives" , 15, "Registry Hive Backup Error", 0     >> %Tmp%\Popup.vbs
  37. Wscript %Tmp%\Popup.vbs
  38. )
  39.  
  40. If Exist "%Tmp%\Popup.vbs" Del %Tmp%\Popup.vbs >nul
  41.  
  42.  
  43.  
  44. REG SAVE HKU\.DEFAULT C:\Registry_Backups\DEFAULT
  45. REG SAVE HKLM\SAM C:\Registry_Backups\SAM
  46. REG SAVE HKLM\SECURITY C:\Registry_Backups\SECURITY
  47. REG SAVE HKLM\SOFTWARE C:\Registry_Backups\SOFTWARE
  48. REG SAVE HKLM\SYSTEM C:\Registry_Backups\SYSTEM
  49. REG SAVE HKCU C:\Registry_Backups\NTUSER.DAT
  50.  
  51.  
  52. :IsAdmin
  53. Reg query "HKU\S-1-5-19\Environment"
  54. If Not %ERRORLEVEL% EQU 0 (
  55.  Cls & Mode CON  LINES=5 COLS=48 & Color 0C & Title - WARNING -
  56.  Echo.
  57.  Echo.
  58.  Echo  YOU MUST HAVE ADMINISTRATOR RIGHTS TO CONTINUE
  59.  Pause >Nul & Exit
  60. )
  61. Cls
  62. Goto :EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement