Enable Automatic Backs up of System Registry

Page 1 of 6 123 ... LastLast

  1. Posts : 5,324
    Windows 11 Pro 64-bit
       #1

    Enable Automatic Backs up of System Registry


    This batch script enables automatic backs up of system registry to C:\Windows\System32\Config\RegBack folder on Windows 10. Restart your computer to make changes take affect.

    Code:
    :: Enable Automatic Backs up of System Registry to C:\Windows\System32\Config\RegBack Folder on Windows 10
    @Echo Off
    Cls & Color 0E
    
    Cd %systemroot%\system32
    
    
    
    
    net sess>nul 2>&1||(start mshta vbscript:code(close(Execute("CreateObject(""Shell.Application"").ShellExecute""%~0"",,,""RunAs"",1"^)^)^)&exit)
    
    
    
    
    Cls & Mode CON  LINES=11 COLS=85 & Color 0E & Title Created By FreeBooter
    Echo.
    Echo.
    Echo.
    Echo        Enable Automatic Backs up of System Registry to RegBack Folder (Y/N)?   
    Echo.       
    Echo.
    Echo.
    
    
    Set /p input= RESPONSE: 
    
    If /i  Not %input%==Y (Goto :_Ex) Else (Goto :_Start) 
    
    :_Ex
    If /i Not %input%==N  (Goto :EOF) Else (Goto :_RegRestore)
    
    
    
    :_Start
    
    Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" /v "EnablePeriodicBackup" /t REG_DWORD /d "1" /f >Nul
    
    
    Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
    Echo.
    Echo.
    Echo.
    Echo.
    Echo         Enabling Automatic System Registry Backup   
    Echo.
    Echo.
    Echo. 
    Ping -n 6 localhost >Nul
    Exit
    
    
    :_RegRestore
    
    Reg.exe delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" /v "EnablePeriodicBackup" /f >Nul
    
    
    
    Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
    Echo.
    Echo.
    Echo.
    Echo.
    Echo        Disabling Automatic System Registry Backup  
    Echo.
    Echo.
    Echo. 
    Ping -n 6 localhost >Nul
    Exit

    Last edited by FreeBooter; 27 Feb 2020 at 14:27.
      My Computer


  2. Posts : 68,845
    64-bit Windows 11 Pro for Workstations
       #2
    Last edited by Brink; 30 Jul 2019 at 10:06. Reason: added link
      My Computers


  3. Posts : 1,345
    Windows 10 Pro 64-bit
       #3

    FreeBooter said:
    This batch script enables automatic backs up of system registry to C:\Windows\System32\Config\RegBack folder on Windows 10. Restart your computer to make changes take affect.

    Code:
    :: Enable Automatic Backs up of System Registry to C:\Windows\System32\Config\RegBack Folder on Windows 10
    @Echo Off
    Cls & Color 0E
    
    Cd %systemroot%\system32
    
    
    
    
    net sess>nul 2>&1||(start mshta vbscript:code(close(Execute("CreateObject(""Shell.Application"").ShellExecute""%~0"",,,""RunAs"",1"^)^)^)&exit)
    
    
    
    
    Cls & Mode CON  LINES=11 COLS=85 & Color 0E & Title Created By FreeBooter
    Echo.
    Echo.
    Echo.
    Echo        Enable Automatic Backs up of System Registry to RegBack Folder (Y/N)?   
    Echo.       
    Echo.
    Echo.
    
    
    Set /p input= RESPONSE: 
    
    If /i  Not %input%==Y (Goto :_Ex) Else (Goto :_Start) 
    
    :_Ex
    If /i Not %input%==N  (Goto :EOF) Else (Goto :_RegRestore)
    
    
    
    :_Start
    
    Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" /v "EnablePeriodicBackup" /t REG_DWORD /d "1" /f >Nul
    
    
    Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
    Echo.
    Echo.
    Echo.
    Echo.
    Echo         Enabling Automatic System Registry Backup   
    Echo.
    Echo.
    Echo. 
    Ping -n 6 localhost >Nul
    Exit
    
    
    :_RegRestore
    
    Reg.exe delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" /v "EnablePeriodicBackup" /f >Nul
    
    
    
    Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
    Echo.
    Echo.
    Echo.
    Echo.
    Echo        Disabling Automatic System Registry Backup  
    Echo.
    Echo.
    Echo. 
    Ping -n 6 localhost >Nul
    Exit
    That is fantastic, works like a charm. I've been out of creating batch scripts since I left the working world but I use to love creating them. Well, I can't create them like I did once upon a time but it sure was easy putting yours to good use.
      My Computer


  4. Posts : 5,324
    Windows 11 Pro 64-bit
    Thread Starter
       #4

    Thank you!
      My Computer


  5. Posts : 1,345
    Windows 10 Pro 64-bit
       #5

    Thanks Brink, I just went through that. I haven't had to recover from a corrupt registry but all of those posts were very interesting to read.
      My Computer


  6. Posts : 245
    windows 10
       #6

    Backing up the Registry in Windows 10 (v1903)


    As I understand it, MS no longer backs up the registry as of v1809 but it can be done manually following the instructions in this short YouTube video; however, this procedure did not work.
    According to this MS article, upon reboot a task called RegIdleBackup should be scheduled but it wasn't, so maybe(?) that is the problem.

    Thanks in advance for any thoughts on how to get the Registry backup to work.
    Dan
      My Computer


  7. Posts : 245
    windows 10
       #7

    FreeBooter said:
    This batch script enables automatic backs up of system registry to C:\Windows\System32\Config\RegBack folder on Windows 10. Restart your computer to make changes take affect.



    Code:
    :: Enable Automatic Backs up of System Registry to C:\Windows\System32\Config\RegBack Folder on Windows 10
    @Echo Off
    Cls & Color 0E
    
    Cd %systemroot%\system32
    
    
    
    
    net sess>nul 2>&1||(start mshta vbscript:code(close(Execute("CreateObject(""Shell.Application"").ShellExecute""%~0"",,,""RunAs"",1"^)^)^)&exit)
    
    
    
    
    Cls & Mode CON  LINES=11 COLS=85 & Color 0E & Title Created By FreeBooter
    Echo.
    Echo.
    Echo.
    Echo        Enable Automatic Backs up of System Registry to RegBack Folder (Y/N)?   
    Echo.       
    Echo.
    Echo.
    
    
    Set /p input= RESPONSE: 
    
    If /i  Not %input%==Y (Goto :_Ex) Else (Goto :_Start) 
    
    :_Ex
    If /i Not %input%==N  (Goto :EOF) Else (Goto :_RegRestore)
    
    
    
    :_Start
    
    Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" /v "EnablePeriodicBackup" /t REG_DWORD /d "1" /f >Nul
    
    
    Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
    Echo.
    Echo.
    Echo.
    Echo.
    Echo         Enabling Automatic System Registry Backup   
    Echo.
    Echo.
    Echo. 
    Ping -n 6 localhost >Nul
    Exit
    
    
    :_RegRestore
    
    Reg.exe delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" /v "EnablePeriodicBackup" /f >Nul
    
    
    
    Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
    Echo.
    Echo.
    Echo.
    Echo.
    Echo        Disabling Automatic System Registry Backup  
    Echo.
    Echo.
    Echo. 
    Ping -n 6 localhost >Nul
    Exit
    I already did a REGEDIT to assign 1 to the newly created EnablePeriodicBackup parameter and that didn't work. So I'm wondering why this script will be any different?
    Thanks,
    Dan
      My Computer


  8. Posts : 5,324
    Windows 11 Pro 64-bit
    Thread Starter
       #8

    After you enable the above registry setting. Windows will backup the registry to the RegBack folder once in 10 days, and when the Automatic Maintenance kicks in. Registry backup also happens when user leaves the system idle for a considerable time.

    You may also launch Task Scheduler, right-click on the Registry Idle task and click Run to backup registry hives on demand. The RegIdleBackup task is located in the Scheduled Task Library, under the Microsoft\Windows\Registry folder.

    You can also execute RegIdleBackup task by executing following command:

    Code:
    schtasks /run /i /tn "\Microsoft\Windows\Registry\RegIdleBackup"
      My Computer


  9. Posts : 245
    windows 10
       #9

    FreeBooter said:
    After you enable the above registry setting. Windows will backup the registry to the RegBack folder once in 10 days, and when the Automatic Maintenance kicks in. Registry backup also happens when user leaves the system idle for a considerable time.

    You may also launch Task Scheduler, right-click on the Registry Idle task and click Run to backup registry hives on demand. The RegIdleBackup task is located in the Scheduled Task Library, under the Microsoft\Windows\Registry folder.

    You can also execute RegIdleBackup task by executing following command:

    Code:
    schtasks /run /i /tn "\Microsoft\Windows\Registry\RegIdleBackup"
    Hi FreeBooter:
    I don't see a RUN option when I right-click on RegIdleBackup in the Task Scheduler:

    Enable Automatic Backs up of System Registry-image.png

    and when I go to "C:\Windows\System32\Tasks\Microsoft\Windows\Registry\RegIdleBackup" and right-click on RegIdleBackup there is no RUN option either.

    You also suggested executing from the DOS screen. Should I supply the full path name ("C:\Windows\System32\Tasks\Microsoft\Windows\Registry\RegIdleBackup") after the 'tn' parameter?

    One last clarification
    : Are you saying that Windows 'decides' when to run the backup and I should not expect the backup to occur immediately after the next bootup, but can occur anytime 10 days after that?

    Thanks,
    Dan
      My Computer


  10. Posts : 5,324
    Windows 11 Pro 64-bit
    Thread Starter
       #10

    Enable RegIdleBackup task to have a Run context menu option.

    Execute the command as schtasks /run /i /tn "\Microsoft\Windows\Registry\RegIdleBackup" you don't need to change anything with the command.

    I can't promise that your system will be idle for a considerable time for registry hives backup to happens you may need to check the RegBack folder to see if backup created.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 18:15.
Find Us




Windows 10 Forums