Restore Windows Registry – 3 Ways
Restoring the registry from an automatically created backup will help restore the operation of the Windows operating system in case of problems with the computer. This is one way to troubleshoot Windows crashes.
The Windows registry (system registry) is a tree-like hierarchical database of settings and parameters of the operating system. The operation of the operating system, programs, and computer hardware depends on the registry settings.
As a result of the actions of third-party software or viruses, changes occur in the Windows registry, which disrupts the operation of the operating system. Therefore, the user needs to restore the normal functioning of his PC.
Ways to restore Windows registry
If your computer starts to crash and malfunction, errors appear, you need to solve the problem: perform a system restore. There are several ways for the user to restore the entire system or individual Windows components.
Depending on the nature of the Windows problem, you can use the following troubleshooting methods:
- Restoring Windows from a pre-created system backup.
- Restore using a previously created Windows restore point .
- Restoring the Windows Registry.
- Checking and automatic recovery of Windows system files.
In the first two cases, you will need to have a backup system image or Windows restore points. After the restore, the system registry will be restored to the state it was in when the Windows backup or system restore point was created.
Automatic system file repair will not always solve the problem of crashes in Windows, because there may be other causes of problems on the PC.
Restoring the system registry can be performed from a previously created registry backup, or using a registry backup created automatically by system tools.
Restoring the registry from a previously created backup
This method is not very common due to the fact that users usually do not backup the registry, preferring other backup methods.
The disadvantage of this option is that an old copy of the registry may be available. After the restore process is completed, conflicts may occur on the computer between the old system settings and newly created settings that did not exist at the time the backup was created.
The user needs to back up the registry in advance. Read a detailed article on this on my website.
Run a system registry restore from a running Windows operating system:
- Select a registry backup on your computer.
- Right-click on the file with the “.reg” extension, select “Merge” from the context menu.
After a reboot, the system registry will be restored to the state it was in when the backup was created.
Automatic creation of an archive copy of the registry in Windows
The Windows Task Scheduler automatically backs up the registry once every 10 days in the “RegBack” folder located along the path:
The “RegBack” folder contains the registry files: “DEFAULT”, “SAM”, “SECURITY”, “SOFTWARE” and “SYSTEM”.
The original registry files are located in the “config” folder located along the path:
If you encounter problems in the operation of Windows, corrupted registry files should be replaced with backup copies created automatically.
Restoring the Registry from the Windows RE Recovery Environment – Method 1
In a running Windows operating system, you will not be able to replace the registry files from a backup due to the fact that the system is running, you will be denied access.
To replace the registry files, you must boot the Windows Recovery Environment on your computer. Also, running WinRE is necessary if the system cannot be booted. You can start the Windows RE recovery environment in several ways, which are described in an article on my site.
You can enter Windows RE from a running operating system, or boot from external media: the Windows Recovery Disk, from a bootable Windows flash drive, or from a DVD disc on which the Windows distribution is recorded.
In the recovery environment, we need the command line. The recovery environment interface is slightly different on different systems. In the tool selection window, click on the “Command Prompt” system tool.
If you are using a bootable USB flash drive or a Windows installation disk, in the Windows Setup program, in the second window, select “System Restore”, and then, among the suggested tools, the command line.
First we need to find out the name of the drive on which the operating system is installed, because in the recovery environment, the name (letter) of the system drive does not always match the name displayed on a running computer.
- In the command line interpreter window, type the command “diskpart” (without quotes), and then press the “Enter” key.
- Enter the command “list volume” (without the quotes) to list all disks on the computer.
- To exit the Diskpart utility, type “exit” (without quotes).
Run a registry restore from a backup copy:
- Run the command to copy the system registry files and replace the damaged files:
xcopy c:\windows\system32\config\regback c:\windows\system32\config
- In the answer to the question, enter “a”, after which the registry files will be replaced.
Close the command prompt window, exit the WinRE recovery environment, restart Windows on the computer.
Restoring the registry using Windows RE – method 2
In the first case, we restored the registry files from a backup by running the command. The second way you can do the same by copying files.
- In the WinRE recovery environment, launch a command prompt.
- In the command prompt window, enter the command “notepad” (without the quotes) to launch the Notepad program.
- In the Notepad window, go to the “File” menu, select “Open …”.
- In the window that opens, enter the folders “Windows”, “System32”, “config” one by one.
- In the “Files of type” option, select “All Files”. In the folder you will see registry files: “DEFAULT”, “SAM”, “SECURITY”, “SOFTWARE”, “SYSTEM”.
- Add “.old” or “.bak” extension to filenames to rename them.
- Select the file, right-click on it, select “Rename” in the context menu, add the extension to the file name.
- Enter the “RegBack” folder, select the file.
- Use the keyboard shortcut “Ctrl” + “C” to copy the file from the “RegBack” folder.
- Open the “config” folder, paste the copied file there, using the “Ctrl” + “V” keys.
Exit the recovery environment, restart your computer.
Restoring the Windows 10 registry – 1 way
In the Windows 10 operating system, starting with version 1803, automatic registry backup has stopped working. In the Windows Task Scheduler, the backup function works, but there are no registry files in the RegBack folder.
In the Task Scheduler window, following the path: “Task Scheduler Library” → “Microsoft” → “Windows” → “Registry”, you can see that the registry backup task “RegIdleBackup” was scheduled here.
Changing the task start time on your own does not lead to anything, the registry is not saved, the RegBack folder is empty.
This was puzzling, users thought it was a system error. Some time later, Microsoft clarified the reason why it deliberately disabled registry backup.
This is done to save space on the system drive, because a significant number of users do not have enough free space to receive “large” OS updates. A controversial solution for saving 100-150 MB of disk space, depending on the size of the system registry.
What should Windows 10 users do? Create the “MyRegIdleBackup” task yourself to automatically create scheduled backups of the registry. As a result, the “MyRegBack” folder will be created, located in the “config” folder, in which archived copies of the registry files will be saved weekly.
- Run command prompt as administrator.
- In the command line interpreter window, run the command:
md %WinDir%\system32\config\MyRegBack & schtasks /create /ru system /sc weekly /st 19:00:00 /tn "MyRegIdleBackup" /tr "cmd /c del /f /q %WinDir%\system32\config \MyRegBack & cd /d %WinDir%\system32\config\MyRegBack & reg save HKLM\SAM SAM & reg save HKLMSECURITY SECURITY & reg save HKLM\SOFTWARE SOFTWARE & reg save HKLM\SYSTEM SYSTEM & reg save HKU\.DEFAULT DEFAULT"
To restore the registry from the recovery environment using the method described above, you must use the command:
xcopy c:\windows\system32\config\myregback c:\windows\system32\config
In Windows RE on your computer, if the system drive has a different name than “C:”, replace the name with your drive letter in this code. The registry files are copied from the “MyRegBack” folder.
Restoring the Windows 10 Registry – Method 2
The next method involves applying changes to the registry. Do the following:
- Launch the Registry Editor (in the search bar type “regedit”).
- In the “Registry Editor” window, follow the path:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager
- Right-click on the “Configuration Manager” section, select “New” in the context menu, then “DWORD (32-bit) Value”.
- Name the parameter: “EnablePeriodicBackup”.
- Right-click on the parameter, select “Edit…”.
- In the “Change DWORD (32-bit) Value” window, in the “Value” field, set “1”.
- Restart your PC.
You can use ready-made registry files that can be downloaded from here. Unzip the archive with two files with the “reg” extension.
To enable backup in Windows 10, run the “enable-periodic-registry-backup.reg” file. If you need to disable registry backup, run the “disable-periodic-registry-backup.reg” file.
In the event of a problem with the Windows operating system, the user can restore the registry from a previously created archive copy, or from an archive copy automatically created by the system tool. Most often, recovery is performed from the Windows RE recovery environment, using the command line, running a command, or manually copying files.