More on backing up and restoring the Registry
In a previous page I outlined some general procedures for the important task of backing up and restoring the Windows Registry. In this article, I will present some procedures in more detail and discuss when to use various possible backup methods. Note that many Registry settings are user-dependent so each user account may need its own backup.
As discussed previously, System Restore is an easy way to back up the Registry and on many systems is done automatically every day. However, System Restore backs up much more than just the Registry and cannot be used specifically for the Registry itself or for individual parts of the Registry. Also, the restore points that are created reside on the main hard drive and cannot be used to help fix a system that will not boot. While System Restore is very useful (I have used it many times), it is also wise to have alternate methods of backup and these are discussed next.
The Emergency Recovery Utility NT (ERUNT)
A freeware program that is widely used for Registry backup is called the "Emergency Recovery Utility NT" or ERUNT. This program allows a Registry backup to be placed on another drive or location. It works in Windows XP, Vista, and 7. Like any system utility, It must be run with administrator privileges. The program author recommends turning off User Account Control (UAC) in Windows Vista and Windows 7 but I have had no trouble using the "Run as Administrator" entry in the right-click context menu.
As the figure below shows, the dialog box for ERUNT gives you a choice of where to store your Registry backups. The backup folder that you choose will also contain a file ERDNT.EXE that is the executable that is used to restore a backup. Note that this file must reside in the same folder as the backup.
ERUNT comes with many command-line options and can be set to back up the Registry on a regular schedule. ERUNT can be used in scripts but because of UAC in Vista/7, scripts would have to be configured in these systems to run with administrator privileges. Detailed information on how to schedule or use ERUNT in scripts is at this link. The information describes various command-line switches that are available. There is also a site with answers to Frequently Asked Questions. How to run daily backups using ERUNT in Vista is described at this link.
A distinct advantage of the ERUNT restoration is that it can be run from an external emergency boot disk. If a system will not boot because of a corrupted Registry, it provides a way to fix the problem. One widely used emergency boot disk that includes ERUNT is thee Ultimate Boot CD for Windows.
Backup Utilities included in Windows
Each version of Windows includes some sort of backup utility. (It has to be installed separately in Windows XP Home.) In XP, the backup contains an option for the "system state" that includes the Registry together with some other files. Personally I have found the XP backup facility to be lacking and I gave up using it. I think there are better ways.
Windows Vista and 7 have better backup facilities but they no longer have the "system state" option. They are aimed at backing up individual files or the entire computer. A backup for the Registry per se is not included. To specifically back up the Registry or parts of the Registry, the Registry Editor can be used in all versions of Windows and its application is discussed next.
Using the Registry Editor (Regedit.exe) for backups
As mentioned previously, the Registry Editor (Regedit) has an export function that provides for backing up individual Registry keys or even the entire part of the Registry that is available to Regedit. (A great deal of the Registry is not accessible for security reasons.) There are two relevant formats, one in text and one in binary. The text format (REG files) s best for backing up smaller parts of the Registry, for example before editing a sub-key. The binary form is good for backing up entire root keys, or hives, as they are called.
Note that restoring Registry keys with REG files merges the contents into the Registry and does not delete anything that may have been added since the creation of the REG file. Binary hive files, on the other hand, delete all pre-existing entries when imported. The binary files are also considerably smaller than REG files. However, REG file can be very substantially compressed by zipping them.
To create either a REG or a hive file go to the Registry file menu ( shown on the right) and choose "Export.." A dialog box will open with the various options for saving an export file. The lower part of the dialog box is shown in the figure below. In the "Save as type" line, a dropdown menu lists the various possible export file formats. Only the top two, REG and hive files, are relevant for most PC users. To restore a Registry key or hive with a backup hive file, use the "Import" function. REG files can be merged into a Registry by right-clicking the file and choosing "Merge".
Using the Command-line to back up and restore the Registry
Regedit.exe provides a graphical user interface for manipulating the Registry but there is also a command-line utility with a similar name reg.exe that is a powerful and versatile way to manage the Windows Registry. For example, REG files can be exported or imported using the command line and entering (with actual values for the KeyName and FileName):
REG EXPORT KeyName FileNameand
REG IMPORT FileName
The various features of this command and details of backing up and restoring the Registry are discussed at commandwindows.com. The command prompt is sometimes the best way to restore a corrupted Registry that is causing trouble booting Windows. Windows Vista and Windows 7 full installation discs (not restore discs) generally provide access to a command-line facility.
Speed Up Your PC:
Optimize Your Computer's Performance in 3 Mins!