A damaged Registry file can lock you out of your system and important files. We explain how to cure - and prevent - this problem with our essential guide
he Registry is a vital part of your Windows installation. It's a massive database that contains all your system and program preferences, and is central to the way Windows works. It's basically a set of files - most stored in the WINDOWS\System32\Config folder - that can become corrupt like any other file. If the Registry is damaged in any way, you may find yourself unable to boot into Windows putting your data at risk, so what can you do to fix this problem? This tutorial presents the complete guide to recovering your system from a corrupt Registry.
In most cases, Registry damage can be caused by a faulty hardware or software installation. You restart your system and suddenly Windows won't boot. In cases like this, it pays to work your way through the start-up menu that appears when Windows fails to load (you can also access this by tapping the [F8] key when Windows starts to load).
The simplest thing to try is Last Known Good Configuration. This attempts to replace the Registry with the version that was used the last time Windows successfully loaded. In most cases this will fix the boot problem, although you'll find any changes made to the Registry since that copy was made are lost.
Last Known Good Configuration will work in many instances, but not all. When it fails to fix the problem, you need to access System Restore from Safe mode - see the box below for details.
Fix your Registry with the help of System Restore
Windows' principal weapon in the fight against Registry damage is System Restore. Not only does this roll back various system files, it also returns your Registry to the state it was in when the Restore point was taken.
If you can boot into Safe mode or Safe mode command prompt only, you can use System Restore to return your PC to a working state. If you can get into Safe mode proper, log in as the Administrator and - when prompted, click No to launch System Restore.
If you can only access Safe mode via the command prompt, log on as Administrator as before, and type the following in to launch System Restore, pressing [Enter]:
Choose an earlier point - starting with the most recent - and see if that eradicates the problem; if necessary try earlier Restore points until you find one that works. Be warned: the further you go back, the more unrecognisable your system will be after the Restore has been performed: your data will be untouched, but programs, hardware and settings installed since that Restore point will either stop working or vanish completely from your system.
Corrupt Registry fix
In the worst-case scenario you won't be able to boot into any flavour of Windows at all, even Safe mode. When this happens there are two symptoms that point to a corrupt Registry: first, your PC continually restarts whenever you try to start it. Try as you might you cannot get into Windows, either using Last Known Good Configuration or any of the Safe mode options. The second is if you are told there's a Registry File Error, or that one of the following files is missing or corrupt: \WINDOWS\SYSTEM32\CONFIG\SYSTEM, or \WINDOWS\SYSTEM32\CONFIG\SOFTWARE.
If you're a Windows Vista user, you should be able to access System Restore from the repair options on your installation disc (if your PC came with a recovery disc, try pressing [F8] on bootup to see if there are any repair options; otherwise click here for details of creating a rescue CD on a working PC). Click Next at the first screen, choose Repair your computer at the second and then click System Restore to launch it.
Windows XP fixes
XP users don't have this fail-safe mechanism built-in, so if you're unable to boot into it you'll have to follow a complicated process. Click here to download a guide in PDF format, which you can print out. You'll need access to the Recovery Console on a Windows XP installation disc - click here if you don't have that disc.
As with most things in life, prevention is always better than the cure, so now is the time to take the steps that can turn a major hassle into a minor irritant.
Although Windows has its own built-in back-up Registry tools, the scenario above proves they're not infallible - particularly if you're a Windows XP user. As a result, it makes perfect sense to take matters into your own hands. Thankfully, there's a tool that makes this back-up process simple and painless, and it's completely free. That program is ERUNT, and you'll find it here.
During installation, the program will ask you if you'd like it to start with Windows, making a backup of your Registry each time you boot the system. For maximum protection, we suggest you let it do this. Once done, untick the Show documentation box and click Finish. ERUNT will make its first backup, which it stores in the Windows\ERDNT folder. You can move this elsewhere if you like, but it's placed here for a reason: that reason is that if you need to restore your computer using the Recovery Console, you only have access to a limited number of folders and drives - and the Windows folder is one of them.
By default, the program will back up the main Registry and your user Registry file only - if more than one person is currently logged on to your PC, tick the Other open user registries box before clicking OK (ERUNT won't back up user profiles not currently logged on - you should install the program separately for each user). A new folder will be created with the day's date, and the Registry will be backed up into it.
There are numerous ways to recover a corrupt Registry from a ERUNT backup - full details are in the program's documentation (see here). We're going to look at the worst-case scenario: that your computer has completely refused to boot into any form of Windows as described earlier.
If you created the BartPE rescue CD (find out how, here), you can boot from that and run the recovery batch file within BartPE - see the "Registry recovery with BartPE" box below for details. If you don't have it, you'll need to use the Recovery Console from your Windows XP CD. If your PC shipped with a recovery CD you can either create a rescue CD with access to the Recovery Console (click here) or borrow a copy from a friend.
Registry recovery with BartPE
BartPE makes troubleshooting and fixing problems that prevent you from accessing Windows a doddle. If you've backed up your system with ERUNT for example, it provides a much friendlier interface with which to restore a working Registry backup.
Once booted into Bart PE, click Start > Run (click Go > Programs > A43 File Management Utility if you didn't add the Windows XPE component). Then just browse to the C:\WINDOWS\ERDNT directory, where you'll find folders containing various dates on them. If you've relied on ERUNT to back up your Registry every time Windows starts, open the AutoBackup folder to find them all.
Locate the folder with the latest date on it and open it up, then double-click the ERDNT.EXE file in the right-hand window. Follow the instructions and that Registry will be restored. Now restart your PC and remove the BartPE disc. Windows should now boot correctly; if it doesn't, repeat the process above, choosing an older Registry until you find one that works.
If you're using your Windows CD or rescue disc, make sure your PC can boot from CD - you should see a message prompting you to press any key to boot from CD or DVD if this is the case. If it isn't, look for an option to select the boot device from a menu, or failing that, press the key displayed to enter setup - typically [Del] or [F2]. Within the BIOS set-up screen, navigate through the various menus looking for the Boot Priority options. When you find them, make sure the first boot device selected is the CD-ROM, with the hard drive (or HDD-0) the second one. Save your changes and restart.
When the initial set-up screens vanish, you'll see a message asking if you wish to boot from CD. Press any key to do so. Let Windows Setup load its various files, then press [R] when prompted to launch the Recovery Console. Once loaded, press  followed by [Enter] when asked which Windows installation to access. Next you'll be asked for your administrative password - in most cases just press [Enter] to get limited access to your system. Then follow the step-by-step guide below to restore your Registry from an ERUNT backup.
Tweak back-up settings
By default, ERUNT's AutoBackup feature will keep Registry backups for 30 days to prevent your disk becoming filled with Registry backups. If this is too long (or too short) you can change this. To do so, click Start > All Programs > Startup, right-click ERUNT AutoBackup and choose Properties. Add the following to the end of the Target: line, replacing 7 with the number of days you wish it to keep backups for:
To tweak ERUNT's default settings further, check out the online documentation here.
Restore your Registry with ERUNT
1. LOCATE BACKUPS
Log on to the Recovery Console (see the main text). When the C:\WINDOWS> prompt appears, type cd erdnt and press [Enter]. If your backups are made automatically, type cd autobackup and press [Enter]. Type dir and press [Enter] to see a list of the folder's contents.
2. PICK YOUR CHOSEN REGISTRY
We recommend picking the latest date from the list - type cd 00-00-0000 and press [Enter], replacing 00-00-0000 with the date on the folder you wish to restore. Now type batch erdnt.con and press [Enter] to launch the recovery tool.
3. REGISTRY RESTORED
ERUNT will now restore the Registry one file at a time. Once it's complete, type exit and press [Enter] to let Windows boot normally (don't press any key when prompted to boot from CD). If the backup fails, repeat the process, picking an earlier Registry folder.