Because the Registry is now the one place where all the Windows hardware and software settings are stored, it's also the one thing that Windows absolutely needs to run. You will hear dire warnings from Microsoft, other computer books, installation manuals, and now me: It's very important to back up the Registry before you edit it. If a critical entry is lost or changed incorrectly (for example, one that holds the name of a driver file for your graphics display adapter), Windows may not be able to start at all.
Make it a habit to back up the Registry every time you back up your hard disk and before you install new hardware or software. I can tell you from personal experience that without a Registry backup, something as common as a bad graphics card installation program can cost you a whole day of trying to get your system to boot again! Windows XP Professional has some built-in protection to help avoid this type of disaster, but you should still take your own precautions. Backing Up the RegistryYou can back up the Registry in Windows XP in three main ways: You can back it up as part of a regular disk backup, you can use the Registry Editor to save a key to a disk file, or you can use a special-purpose Registry backup program. I suggest that you set your favorite disk backup program to back up the Registry files every time you back up your hard disk. Before you install a piece of new hardware or a significant software package, do a full disk backup, including the Registry. Before you manually edit the Registry for other purposes, back up the Registry by any of the means I'll discuss in the next few sections. TIP An Automated System Recovery backup is a fourth Registry backup of sortsit saves the most critical, hardware-related information from the Registry on the Emergency Repair Diskette (ERD), then puts everything in the larger backup set. An up-to-date ERD can help you get Windows back on its feet if you have a Registry or other disaster. If you really want to get a gold star for preparedness, update your ERD every time you've added new hardware, after it has proven to be stable and work correctly.
To learn how to make an Emergency Repair Disk, p. 1142. Backing Up with Windows BackupTo run the Backup utility included with Windows XP Professional,
The System State backup option backs up the Registry along with boot files, Active Directory files, and Certificates. For this reason, it is a good idea to select System State every time you make a backup, to disk or tape. Now, with this backup on hand, if Registry problems occur after your installation, you can use the Backup utility again to restore the Registry to its previous state. Although it's best to perform a full backup to tape, disk, or other high-capacity storage media, you can perform a quick System State backup to a local disk file in preparation for adding new hardware or software. NOTE With Backup, you cannot save the System State of a remote computer, only the local computer. For remote or centralized backup servicesto back up the Registries of all the computers on your networkyou need to buy a third-party backup program. If you're managing a large network of computers, you should definitely investigate centralized backup systems. Backing Up with Third-Party Disk Backup SoftwareThird-party disk backup software made for Windows XP Professional will include an option to back up the Registry. Be sure to check this option whenever you are backing up your hard disk. It may have options like the Windows Backup program to back up just the Registry and to back up to a disk file, so you can make a quick backup before attempting Registry edits. You should check your backup software's manual for instructions on saving Registry and system information when you back up. I suggest that you always include the Registry in your backups. Backing Up with Third-Party Registry Backup SoftwareThere are third-party programs specifically designed to back up and restore the Registry and other critical Windows files. For example, SuperWin's WinRescue XP program (www.superwin.com) can not only back up and restore the Registry, but can defragment the Registry's files and work magic to revive a non-bootable Windows system. If you're a Registry hacker, it would be worth buying a Registry backup tool. These programs will come with their own extensive instructions on backing up, restoring, repairing, and maintaining the Registry. Backing Up with RegeditThe Registry Editor, called Regedit, has a mechanism to export a set of Registry keys and values to a text file. If you can't or won't use a more comprehensive backup system before you manually edit the Registry, at least use this editor to select and back up the key that contains all the subkeys and values you plan to modify. This way, you can back up all the sections you plan to edit in one backup. That way, if it's necessary later, you can restore these exported files, recovering any changed or deleted keys and values. Remember, though, that Regedit cannot remove entries you added that were not in the Registry before the backup! So, if an entry you add causes problems, the Registry Editor backup will not help you recover. To back up a key and its subkeys and values, follow these steps:
TIP You can use this technique to copy a set of keys and values from one section of the Registry to another. First, export the desired key and values to a file. Edit the file with Notepad, and use the Edit/Replace menu to change all of the key names to the desired new location. Then import the file back into the Registry. I have used this method to copy a group of Registry entries under HKEY_CURRENT_USER to HKEY_USERS\.Default, for example, so that all newly created user accounts will have the desired setting. TIP You can also use exported REG files to simplify the job of copying the same set of registry entries to multiple computers. See the "Tips from the Windows Pros" section at the end of this chapter for details. Restoring the RegistryIf you've made Registry changes that cause problems, you can try to remember each and every change you made, re-enter the original information, delete any keys you added, and thus undo the changes manually. Good luck! If you were diligent and made a backup before you started, however, you can simply restore the backup and have confidence that the recovery is complete and accurate.
To restore a Registry backup you made, follow the steps described in the following sections. Restoring the Registry with Driver RollbackIf you encounter problems immediately after installing or updating a device driver, you might be lucky enough not to need to manually restore the Registry. Windows XP may be able to help you automatically. Use the Device Manager's "Roll Back Driver" feature to see if this fixes your problem.
To see detailed instructions on updating device drivers, p. 1178. Restoring the Registry from Windows BackupThe Windows Backup utility's Restore feature lets you replace Registry and other System files saved before a failed installation or change. This step is fairly drastic, so be sure you've exhausted the less invasive procedures before you resort to this method. If you did a full backup, you're fairly safe because all program files will be restored along with the Registry. If you backed up only the Registry itself, there's a chance that the old Registry entries won't solve any problems created by replaced system programs. Follow these steps to restore the backup:
Restoring the Registry from RegeditIf a Registry editing session has gone awry, and you need to restore the Registry from a Regedit backup, follow these steps:
The saved Registry keys are then imported, replacing any changes or deletions. However, any keys or values you've added to the Registry will not be removed. If they are the cause of the problem, this restore will not help. If the Registry problems persist, you can try a rather drastic measure: You can use Regedit to delete the key or keys that were changed and then import the backup file again. This time, any added keys or values are removed. I suggest you try this approach only with keys related to add-on software, not for any of the Microsoft software or hardware keys. TIP My final word on Registry repair: If you encounter problems with the Registry entries for hardware or for Windows itself, and restoring the Registry doesn't help, you are probably better off reinstalling Windows or using the Emergency Recovery procedure than trying any further desperate measures to fix the Registry. TIP If you encounter what you think are Registry problems with add-on software, your best bet is to uninstall the software, if possible, and reinstall it before attempting any Registry restores or repairs. |