Monday, July 9, 2007

Corrupt Registry!!!!

Oh my, two blog posts in one day. But this one had me sweating quite a bit (not that Forza 2 doesn't )

After playing around installing and testing some old games for my son to play (he's into StarCraft now, but I was always more of a Command & Conquer fan). So I installed the second in the series - Tiberium Sun which had a good story line and much better graphics than the original. But for some reason it wouldn't run correctly, so I uninstalled it this morning (not long after my blog post). I also uninstalled a few other things I don't use while the control panel was open. A dialog wanted me to reboot, but I always decline because I'll do it when I want to. But then my system started acting a little odd, so I obliged and closed everything up and rebooted. And I see the following:

Windows XP could not start because the following file is missing or corrupt: \WINDOWS\SYSTEM32\CONFIG\SYSTEM

along with a suggestion to boot from a Windows XP CD and select 'r' to repair. In my experience, this never works, but I tried it anyway. It didn't work. After some poking around and lots of other things, I found an MS Knowledge Base article that gave me the right clues. Luckily I have a clue with these things and knew not everything was kosher here, so let me outline my fix for anybody else with this issue and also for myself when this happens next time!

The article suggests that you back up your current registry files, which I did and I recommend doing yourself too. Boot with an XP CD and choose 'r' and let it complain about the registry - but it then drops you to a command line. Now just copy the 5 key files: DEFAULT, SAM, SECURITY, SOFTWARE and SYSTEM from c:\windows\system32\config to somewhere like c:\windows\tmp. We can always return to this broken configuration if we need to.

But the next step says to restore backup versions of these files from c:\windows\repair. The problem here is that all these files are dated on my system from when Windows XP Service Pack 2 was released - May 2005. Which means overwriting my corrupt files with these basically blank registry files will reset my system to largely a fresh installation. All the user files will be gone and you'll need to re-install everything. This is not what you want to do unless everything else has failed.

Instead, you want to find more recent versions (un-corrupted hopefully) of your registry files to repair. This is outlined in Part Two of the article. Dig into c:\System Volume Information from the command prompt in the recovery console. Change into a recent _restor{} directory and you'll see a bunch of subdirectories with names like RP815, RP816, etc. Be careful and check times because if you grab the absolute latest, it may be corrupt too -- or if you tried the first suggestion from MS will have the old 2005 registry with new dates. Look into the highest RP### directory under the 'snapshot' directory. Hopefully you'll see a bunch of files with names like _REGISTRY_MACHINE_SYSTEM. If not, move to the next newer restore point -- not every restore point will have a backup of the registry. I had to go back two or three versions to find them. Now, do as the article suggests and copy the 5 files again to c:\windows\tmp so you have another place to restore to. From there, copy these guys to c:\windows\sytem32\config and rename them to their proper names.

Now cross your fingers and type 'exit' to reboot the machine. Hopefully your standard startup screen will show up. Unless you were just doing a major overhaul when the registry was corrupted, you shouldn't notice anything different. Success!

Next step is to load up your backup programs and back up everything you care about. Everything. Go buy an external firewire drive if you need to. Back up everything now because you never know if the next crash will be worse or not!!!

No comments: