Tag Archives: registry

How to recover a corrupt registry that prevents Windows from booting

Today my friend had a problem with his computer, while Windows is booting it restarted unexpectedly without leaving any error message. I tried to boot under safe mode, but still had the same problem, it restarted again. I then tried the start up option “Disable Automatic Restart on System Failure” on the boot menu, this time it gave me the blue screen with the message “registry error 0x000051” and it told me that registry was corrupt. Because of this I had to use the recovery console to replace the corrupt registry with the last good registry found inside the System Volume Information folder, which is where the System Restore’s files located.
Here’s how I did that:

  1. After logging in to the recovery console cd to C:\System Volume Information, then dir to list the directories inside of it, you’ll see a lot of folder named _restore{*} along with their date, cd to the most recent _restore{*} . If you don’t know what recovery console is or you’re not comfortable with it please check out this page.
  2. List all files inside of it and choose the most recent folder RPxxx that you think the registry at that date was still not corrupted.
  3. Cd to the folder Snapshot.
  4. List all files again and you’ll notice something like

    _REGISTRY_MACHINE_SAM
    _REGISTRY_MACHINE_SECURITY
    _REGISTRY_MACHINE_SOFTWARE
    _REGISTRY_MACHINE_SYSTEM
    _REGISTRY_USER_.DEFAULT

  5. Back up the existing registries in the system folder just in case of the something goes wrong we can restore those registries

    copy c:\windows\system32\config\system c:\windows\tmp\system.bak
    copy c:\windows\system32\config\software c:\windows\tmp\software.bak
    copy c:\windows\system32\config\sam c:\windows\tmp\sam.bak
    copy
    c:\windows\system32\config\security c:\windows\tmp\security.bak
    copy
    c:\windows\system32\config\default c:\windows\tmp\default.bak
  6. Replace the corrupt registry in the system by running
    copy _registry_machine_software c:\windows\system32\config\software
    copy _registry_machine_system c:\windows\system32\config\system
    copy _registry_machine_sam c:\windows\system32\config\sam
    copy _registry_machine_security c:\windows\system32\config\security
    copy _registry_user_.default c:\windows\system32\config\default
  7. After replace the above files restart the computer and it should boot appropriately again.