Advertisement
FreeBooter

RegBackup.bat

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