Carl’s Blog

Recovering from Windows registry hive corruption, the clever way.

by Carl Farrington on Jul.26, 2008, under Computer Stuff, Tips & Tricks

I like this trick. Every time I do it, I think about all those people doing repair installs (in-place upgrades).

It works pretty much every time unless the filesystem is really truly screwed, in which case you need a backup, say from the system restore directory (System Volume Information), as per this knowledgebase article (don’t bother with the recovery console though, use your USB to IDE or USB to SATA cable and fix it from your laptop.)

Here are the symptoms. You try to start up your Windows 2000/XP (Vista too?) computer and you get a message, white text on black background:

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

or

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

Sometimes, the message is cut short, so you might see “\WINDOWS\SYSTEM32\CONFIG\SYS” or similar. Hint: If it’s really cut short, and you can’t see if it’s SOFTWARE or SYSTEM, do the following procedure on both files. Whichever one is identified as having been repaired, well that’s the one that was broken ;)

Anyway, how to fix it in 2 minutes:

Use your USB to IDE/SATA adapter cable, and connect the broken machine’s hard drive to your laptop, or your spare PC or whatever. You don’t have to use a USB to IDE/SATA adapter cable – if you’re a person at home with another PC you can stick the drive on a spare IDE or SATA channel. You just need to get that hard drive into a working Windows XP computer for a few minutes.

Windows will mount the broken computer’s hard drive as, say E: or F:. Make sure you have your computer set to show hidden files and also system files. To check this, go into My Computer -> Tools -> Folder Options, -> View Tab, and select “Show hidden files”, and make sure “Hide protected operating system files” is not ticked.

First things first, run chkdsk on that drive, after all it is most likely filesystem corruption that has caused the registry to become corrupt in the first place. In My Computer, right-click the broken computer’s drive and choose properties. Go to tools, “Check Now”, put a tick in only the first box (Automatically fix filesystem errors), and click start. Let that finish before continuing.

Here’s where the magic happens. Go to start -> run, and type regedit [enter]. This will launch the registry editor on your computer. In the registry editor, highlight HKEY_LOCAL_MACHINE, and then go to File -> Load Hive. Find the file that is “missing or corrupt” (from your error message earlier), and choose to load that. It will be in E:\(or F:\)Windows\System32\Config, and will be called just SOFTWARE or SYSTEM. Regedit will ask you to name the hive, just type “badpc” (any old garbage will do – it’s only temporary).

Regedit will say “One or more files containing the registry were corrupt and had to be recovered by use of log files. The recovery was successful.” You have just repaired the registry! Now you need to Un-load that hive, so highlight that “badpc” hive that you can now see under HKEY_LOCAL_MACHINE, and go to File -> Unload Hive.

You now just need to put that hard drive back in the broken computer, which hopefully won’t be broken any more! If you used a USB to SATA or USB to IDE cable from your laptop, make sure you use the “Safely remove hardware” icon in the system tray next to the clock to safely remove the hard drive, else you may cause filesystem corruption again. Alternatively just shut your laptop/working computer down properly and remove the hard drive once it’s shut down.

All done.

Some background:

The registry is a database. It has transaction log files which can be used to recover from corruption. It would appear that the early Windows boot process is not able to work with those log files, but regedit (and Windows itself further on in the boot process) is.

:

117 Comments for this entry

  • Mark Fenberg

    You just saved me from having to completely reload Windows and all applications!

    I’m working on a laptop with a corrupted SYSTEM file. I removed the drive and installed it in an external USB enclosure. Connected it to my laptop and was able to get the owners important documents off it and emailed them to her. The owner is currently going for her Masters degree and had just finished an important paper at 2am two nights ago, which was due today. She normally transfers all documents to her flash drive, but she was tired and went to bed without doing this. The next morning, the computer would not start, giving the dreaded missing system files!

    I was not able to REPAIR Windows, as the setup disk could not find the original installation. I tried your fix of repairing the hive, but it would not work. What I did was to put the drive back in the external enclosure, connect it to my computer and run chkdsk /r, repair the errors and then try your fix again. SUCCESS!! The laptop now boots up and appears to be running fine. Chkdsk did find numerous bad sectors, so I am going to recommend a new hard drive. In the meantime, all is well…thanks to your “fix”! Thanks again!

    Mark

  • Adam

    WORKS AMAZING!! Fast and simple. Thanks a million!!

  • Brent

    Carl, many thanks your way. You know your stuff and this fix worked great for a laptop that I JUST did a full format and software install on last week (a virus had messed it up pretty good). A week after updating it all, the user came back to me and had a corrupt SYSTEM registry on boot up. I dreaded the chkdsk /r and likely upcoming windows repairs/updates… but this trick got me back in just a handful of minutes!

    You’re the man! I’ll be sure to remember this one for future use! Thanks again.

  • Carlos Higgins

    Hi.

    I have corrupt registry files, so it says. It will not let me in to the computer – says I must have a password. I never set up a password. And hitting enter does nothing.

    I have copied most files to an external drive.

    Your “clever way” to repair this appears to be, well, clever.

    But when you say
    don’t bother with the recovery console though, use your USB to IDE or USB to SATA cable and fix it from your laptop.) Do I have to physically remove the hard drive from the bad computer? Or is it just a matter of hooking the two computers to one another? How? Bad computer is a Dell Dimension 8100 with XP Pro. Thanks

  • Patty

    Hi Carl,
    After reading the posts above I got back a little hope for recovering my data! But I need your help…please

    I’m having the same problem, but it’s on my LAPTOP, “Windows could not start because the following file is missing or corrupt = windows\system32\config\system”

    I am not an IT gal, unfortunatly, to be able to physically open my laptop and connect it to another pc. I tried other software solutions but to no success….

    Here is my brif situation. I had a power outage yesterday, and my laptop (hp pavilion dv5000 Intel) was on power supply (battery wasn’t plugged in), and every since, I get the above message. I tried to go into the “R”ecovery as well as simply doing an install with my winXP CD, but a blue screen error come up saying “setup did not find any hard disk drives installed in your computer”….to quite press F3.

    Horrible, I have important documents that I are on this laptop…is there any way that I can recover them?

    Thank you so much Carl is you are able to able to help me out or give me suggestions….

  • Carl Farrington

    Hi Patty, unfortunately to do my fix requires you to whip out the hard disk and attach it to another computer.
    It sounds like your computer uses a hard disk controller that your Windows XP CD doesn’t have inbuilt drivers for. You would need a floppy disk (“F6 floppy” as they’re known) with the drivers for the hard disk controller / storage controller on them and to press F6 at the begining of the Windows XP Setup/Repair startup, where it says “Press F6 to install additional something” at the bottom.

    I think you’ll need to take your laptop to someone with a spare computer, a screwdriver, and a USB to SATA adapter (I am assuming your computer has a SATA drive due to the above).

    You might be able to get the XP CD to recognise your hard disk if you go into the BIOS Setup (tap DEL or F2 or F1 or something as soon as you switch the computer on), and in there change the SATA/Hard disk controller mode from AHCI to IDE or Compatible if there is such an option.

    Good luck. I’d say your data is no doubt fine anyway.

    regards,
    Carl

  • Mark

    Hi Carl, Thank you SO MUCH for this article!
    It worked perfectly. I can’t believe all of those other times that I wasted hours on this stupid problem over my years of doing tech support. You are a genius!
    Thanks!
    -Mark

  • James

    I also have the corrupted SYSTEM file problem. Unfortunately when I tried to load the bad SYSTEM hive on the HKEY_LOCAL_MACHINE directory, the machine rebooted. Does this mean that my bad SYSTEM file is corrupted beyond repaired? Can I still somehow rescue or fix this file? I appreciate if you can give me an idea. Thanks for this wonderful info though!

  • Wayne

    Hi
    I am trying to restore an emachine PC, I followed your instruction which are very well written and detail
    But When I load the hiv and gove ot name badpc the regsedit did not say that the file is corrupted or repair I did unload the hiv and when I plug the hard drive back i still get the same message
    I have the recovery CD and I did run it number of times it did go all the way though (I am asked for a complete recovery including the lost of all data files)
    any help
    I did even use a OEM xp cd to delet the partition and recreate it and that lead me to a blue screen

    Then I went back and use the emachine that came with the PC and did complete system recovery and then the system ask to restart
    and then I get the message
    windows could not start because the following file is missing or corrupt
    windows\system32\config\system

    any help please

  • eric h

    Your tip re putting errant hard drive into an external enclosure brought light to an otherwise black day: I have a Pavilion slimline with all the latest bells and whistles but I was getting the old bluescreen and, finally the macbine died. After many fruitless attempts, following Vista’s suggestions for repairing the drive via f8, I simply went to “open Windows normally and, eureka! it opened. I quickly downloaded and ltest version of Acronis, hoping to save my precious programs, documents, data, etc onto an external drive I bought for just such an eventuality. Alas, from the moment I installed Acronis, the machine slowed and began freezing with every keystroke. When I attempted to create the acronis rescue disk, the computer went dead on me.
    I managed to get it up again – slow and reluctant so I decided to uninstall Acronis. That was not easy: impossible via the uninstall/install program and no visible uninstall filoe to be found anywhere. Went to ac ronis site and downloaded their two-page closely-written instructions for uninstalling via the Registry. In all I was instructed to delete 37 entries! Finally I was finished and, following instructions, rebooted … only it didn’t and nothing I tried – short of putting MY boot to it – would persuade it to do anyting but give me a blank stare.
    Then I saw your blog, dashed out and bought me a new hd case, installed the hd inside and plugged it into my wife’s laptop which also runs on Windows Vista.
    But did it worK? The external fribve flashed from blue to red and from red to blue, wife’s computer slowed to a standstill and after 20 minutes two new drives appeared on her Computer which I assumed were partitions one and two on my hd. When I right clicked on one nothing happened until I got a screen telling me that it was trying to hive windows! after that I got the “not responding” message for each open program. I could not reboot neither could I close down. Finally I had to pull the plug close it manually.
    Thankfully it reopened normally but I am loathe to try the experiment again.
    Perhaps you have some thoughts – useful or otherwise – about my misadventure.
    ortunately my computer is still under warranty and HP are sending me a new harddrive and recovery disks. But that will mean I lose everything on the old hd unless I can find some way to recover via the old drive in the external case. Sorry to be so long-winded. Thanks, eric h

  • Steve

    Thank you Thank you Thank you.
    Your method of restoring the system is amazing. I’m really impressed – Easy and effective. I don’t know what you are paid but it’s not enough!
    Best regerds

  • Carl Farrington

    Eric – sounds like the hard drive is buggered. Best chance of recovery is to use a sector based cloning tool which allows you to limit the number of read retrys on bad sectors, something like Prosoft Media Tools. That program doesn’t support USB though so you’d need to use a regular PC to do the clone. Clone the disk, which might take 12 hours to do if there are many unreadable sectors, then run a chkdsk on the new drive which has had the readable parts of the old drive cloned to it, then re-install/repair any broken programs, which might include Windows itself.

  • Carl Farrington

    Steve – thanks very much for the positive comments, I appreciate it :)

  • Tony

    Just wanted to say that you are a life saver your instruction work flawlessly! great Work!

  • rctay

    I saw your post on

    http://www.softwaretipsandtricks.com/forum/windows-xp/2735-xp-could-not-start-following-file-missing-corrupt.html

    and decided to give it a shot. Boy did it work!

    I’d like to recommend something else for people who have difficulties mounting the “bad” hard disk: you can use BartPE alternatively, which is a pseudo-Windows Live CD, and mount the registry hive from there.

  • Carl Farrington

    That’s a good tip! Thanks very much for sharing.

  • Alen C

    Thanks Carl for the help. I am trying to load the hive but when I go to name the hive “badpc” I get this error message. Can you help?

    —————————
    Load Hive
    —————————
    Cannot Load G:\WINDOWS\system32\config\system: Error while loading hive.
    —————————
    OK
    —————————

  • Bill

    I tried this on a machine and it did get it to boot fine but after the desktop came up and all the icons were loaded, it just kept rebooting. I finally gave up and did a clean XP install on a new hard drive and will transfer all the files. I had my hopes up it would work but unfortunately it didn’t work for me.

  • Jeremy

    I get this also:

    Load Hive
    —————————
    Cannot Load F:\WINDOWS\system32\config\system: Error while loading hive.
    —————————
    OK
    —————————

    HELP!!!

  • Transaction_Seeker

    Is there a way to read the transaction details off of the .log file? This would be very useful to see what was added most recently to the hive. I’m not seeing anyting on this.

  • Carl Farrington

    Transaction_Seeker – it’s not a text log file we’re talking about. It’s a binary logfile noting which bits/bytes of the file have been modified.
    See here for information:
    http://technet.microsoft.com/en-us/library/cc750583.aspx

  • Carl Farrington

    Jeremy & Alen C – you’re both out of luck, sorry. Registry/filesystem too corrupted for recovery via this method.

  • John

    Carl, I also have the ‘error while loading hive’ message. Does this mean the only way to fix is via the long way shown in softwaretipsandtricks.com?

  • Mike

    Thanks for this. Looking forward to trying it. One question before I do: Do I need a working Windows XP machine to fix his or will a Vista computer work?

  • Carl Farrington

    Mike: A Vista machine will be fine. Hope it works for you.

  • Mike

    Worked like a charm! Thank you. I kinda want a friend’s computer to crash so I can show off your technique and my fancy new cables! ;)

  • Andrew

    Absolutely excellent advice – I’ve had this once before at it was a nightmare to recover from. This was a breeze from start to finish! Many thanks…

  • SZA

    after i have done those steps,took out bad hdd into laptop and run laptop..after the OS loading screen..only blank screen appear :(
    what should i do now?

  • Matt

    Carl, you, sir, are a ninja of the computer.

    I got this error, I thought the whole XP install was lost, I put my googling skills to work, and I found your blog. A $20 SATA-to-USB set and 5 minutes on my laptop later, and everything is running flawlessly.

    One other symptom I had that might cause some people despair is that when you do boot from the Windows CD as instructed, trying to use the console or even reinstall XP will display an error saying that it can’t find a valid hard drive– even though the BIOS recognizes it.

    This fix also results in a complete repair for those cases as well, if anyone with that particular problem comes by here and is wondering.

    If you’re ever in the Cleveland area, Carl, I owe you a few beers. :)

    Thanks a ton,
    Matt

  • John

    Hi Carl,

    You sound incredibly intelligent, and I’m really glad I found your blog. My Dell Dimension 8250 just started the whole stop error \WINDOWS\SYSTEM32\CONFIG\SOFTWARE at start up today, and it’s been driving me nuts trying to figure out how to repair it. I have 2 internal hard drives that share some information. (The C drive is the one that failed and has windows on it). I tried going through the repair console originally, but there seems to be no password (including no password) that works, so no dice there.

    As a matter of wondering, did the fix you used keep a decent amount of previous files you had on your drive? It seems like other fixes I’ve found end up removing many of what ever other files were on the drive. My C drive has plenty of files that have nothing to do with the OS that I don’t want to lose. And it seems like the only other alternative is to salvage what I can from the drive and reinstall XP.

    Any additional comments you might be able to make would be greatly appreciated.

  • Gabriel

    same like szo said (after i have done those steps,took out bad hdd into laptop and run laptop..after the OS loading screen..only blank screen appear
    what should i do now?)

    that’s what I expirienced after doing everything with a live windows cd. so there is some other thing wrong in the system…

  • Randy

    Carl…man you helped me a bunch. I have worked in systems for a number of years and didn’t know this. Thanks, it saved me from having to re-install completely.

  • Adrianus

    Hi Carl,

    You seem to have a really good solution to a very bad problem. My question: “How does the procedure look like when Windows is installed on a mirrored RAID system?”

    Best regards,

    Adrianus

  • Levy

    hi, nice blog! i was wondering if you can share info on how to add a comment box like yours to http://torahforever.net

    is basic web knowledge enough or is more needed.

    thank you

  • Carl Farrington

    Levy: I use a blogging system called WordPress. You either download from wordpress.org, install & configure on your own server, as I have done, or you go to wordpress.com (.COM that is..) and sign up for a free hosted blog there. It’s all built into wordpress.

  • Carl Farrington

    Randy: Thanks very much. It was one of those few fixes that was truly “mine” so I was quite pleased to have figured it out and been doing it for a while, especially considering the drawn out re-install procedure, but I get so much help from people on the Internet sharing their fixes for things that I thought a blog and some giving back was due. I appreciate the positive feedback though.. gets lonely doing IT by yourself sometimes ;) :D

    There is another thing I do that I think a lot of people don’t know.. I have tried to share in on Usenet before and I just got burnt down in flames: “you can’t do that. This isn’t the Windows 98 days any more. You have to re-install Windows or it won’t boot”. That was swapping motherboards with dis-similar chipsets on Windows 2000/XP machines.. I still do it and it works fine, and it’s not exactly a secret any more but I reckon enough people still don’t realise how easy it is to just switch the IDE/SATA driver from “VIA/Intel/SiS PCI IDE” to “Generic PCI IDE Controller” before taking out the old motherboard, and avoiding the INACCESSIBLE_BOOT_DEVICE blue screen of death.. I may blog about that one, but it didn’t go down so well last time – too many experts who had never done it before telling me how it didn’t work, vs me who has been doing it for years successfully.

    Adrianus: On a RAID1 mirror, I would take the files (the reg hive in question *and* the associated log file) onto a laptop via USB disk, load them up so that they are repaired in place on the USB disk, and copy back, or alternatively if it’s SATA, drop one of the disks from the mirror and treat it like any other disk. You’d may have to clear the dropped disk before re-inserting though, with dban or something, else it may confuse the array when the disk goes back in.

  • Dr. Goodspeed

    Thank you so much for this fix! It’s brilliant and it worked perfectly! I just saved a user at my corp with this.

    You’re the man!

  • Rob Graham

    Hi carl,
    You sound like a really helpful person, and looks like your method has fixed lots of other peoples problem so thinking of giving ago, the repair options of the xp disk havnt worked. Problem is i have raid 0 striped hdd’s so not sure how this will work or if its possible to use your method. I’m also wondering if one of my hdd’s has failed. Any help would be greatly appreciated cause im stuck big time.
    Many thanks,
    Rob

  • Kaizer

    From one IT worker to another, I just wanted to thank you for pointing this out for me.

    Thanks again.

    -Kaizer

  • Rob

    When I plug in my 2.5′ IDE hard drive into any Windows computer, it will not mount for some reason.
    It shows under the ‘disk drive’ section in device manager as USB Device.
    Please help.

  • Michel

    Hi all,

    When you use a laptop with safeboot, try to do it in bart-pe. You only need a file wich give you acces to the encrypted harddrive. I tried it but unfortunattly this fix didn`t work, run a couple of checkdisk, and did this tutorial several times. I think my registry is to f*cked up.

  • Marius

    Thanks a lot. It really worked on windows 2k3 also. It saved me A LOT of worked.
    You’re great.
    Thanks again!

  • edHo

    Man,,
    it works..
    u r so amazing man..
    thanks a lot..
    u safe my life!!^^,

  • Sheila

    Carl,

    I have the same problem as Rob above and hope you have a solution for us. I have a client’s PC with striped raid drives and the hive error. I downloaded the SATA driver from Dell’s site to a floppy but the Windows XP Repair Console does not recognize it. Can your fix be used and if so can you give us details. I will keep this information for future use. Thanks

  • Ivan

    Thanks

    work. But I used the Win ultimate boot CD and repared the reg files from CD win distribution becasue I have onboard ride instaled in PC and I cant use the USB ata/sata disk reader.

  • Marc

    Amazing. Your solution worked perfectly. And to think I was about to reformat!

  • yasmin

    hi sir carl. thanks for this.. it helped save my head from a lot of head ache.. i want to ask further. can i do this technique using the same laptop? i had 2 operating system (both windows xp currently installed on it. just wondering if that would do the trick.

    here’s what i did: i booted on the other OS so i could access the other one’s files, then i run a check disk (on boot) on the partition with corrupted registry hive. and it seemed like it already did the job. but lately i’m experiencing performance slow down on my computer so i’m having doubts as to.. maybe i should just proceed to the next steps to take care of it. i wish you could help me some more. thanks again :)

  • H€nk

    It’s not working for me, unfortunately Windows won’t start…
    First I did the chkdsk and that took some time (I think 1 hour, for a 40 GB disk) so I think the drive is not in a very good condition. But I can see my files, everything is there.
    After the chkdsk I tried to load the hive into the registry on another machine. No problem! It loads normally, no error messages of anything being corrupt, I can look in the hive and I see familiar stuff.
    Put the HD back in the original machine; “Windows could not start because …” again!
    Also tried to boot the other machine from this ‘corrupt’ HD, same error.

  • Baniel

    Worked beautifully for me, definitely a time saver from recovering with windows!

    Thanks a lot!!!

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...