The registry is the heart of the Windows operating system, but if you aren't careful, working with it can lead to a comatose OS. To insure that the heart of your finely tuned OS stays healthy you need to be proficient in deducing registry errors and backing up and restoring the registry. This article from InformIT's Windows Server Reference guide, takes a look at the various methods of repairing the registry.
Warning! Editing the registry may render the operating system of Server 2003 unusable, and you may even have to reinstall it! Be certain that a current backup is available. Any of the procedures described here are unsupported and are used at your own risk.
Do you think I'm going overboard with all these warnings? Think again. Server 2003 is about as robust an operating system as Microsoft has ever written, but just like heart surgery on an Olympic athlete, one wrong move can kill your patient.
So what should you do? Well, unlike a sprinter or basketball player, you can keep another heart around in case of complete failures. You do this by making a copy of the registry. The registry's usual home is in %systemroot%System32Config, where %systemroot% is the system's root directory. Usually, that's winnt.
Want to know exactly what went wrong? Compare the registry of your dead system with the backup to find differences. You can do this by dumping data from both to a text file, using the regedt32.exe menu command Registry, Save Subtree As. Next, use a text-compare tool such as windiff.exe from the Microsoft Resource Kit (ResKit) to contrast the two.
You can also use windiff.exe to compare desired and undesired registry keys. If you modify the output of the regedit.exe export registry file, cut-and-paste from a good one, and then import that file to the dead machine, you might be able to repair the problem. Depending on the problem, not accounting for variations in directory structures, user accounts, hardware and configuration, IP addresses, etc. could create more problems than are solved.
Keep in mind that several subtrees and keys are linked to others. Go into troubleshooting/repair sessions with a planned purpose and armed with knowledge. Whatever you do, never, ever use Microsoft Word or any other word processor to edit the files before cutting-and-pasting data from the text backup file. All word processors add their own instructions to a document to describe its formatting and so on. Although invisible to the eye in the word processing program, they're visible to your operating system, and your revised registry is guaranteed to fail as a result.
Once you save the key to a file and make the changes, hopefully you'll have solved your problem. If not, restore the key to its pre-fix settings. Even if the change didn't appear to hurt anything, if you don't restore the file to its original condition you may be introducing a new problem that will hide the old one.
Of course, you can always restore a previously working registry by using Backup and Emergency Repair. This is a good technique—with one big drawback. If there have been any system changes not accounted for in the backup, you stand to lose those changes on reboot. That may mean that you'll need to reinstall software, re-create user accounts and profiles, update drivers, and so on.
The solution? It comes in two parts: One, edit the registry directly only when you've run out of other options using higher-level management tools. Two, make daily backups of your registry. Trust me, you'll be glad you did.
Read more about the registry and other Windows issues at InformIT.
This was first published in January 2004