How to manually recover a corrupted registry that prevents Windows XP from starting.

If you boot in diagnostic mode, the boot will stop and display the error:

Stop: c0000218 {Registry File Failure}

The registry cannot load the hive (file):

\Systemroot\System32\Config\SOFTWARE

or its log or alternate

 

Create two batch files:

  • Create two batch files on another computer (if this is not possible, you can type all the lines at the Recovery Console prompt):
  • Create a text file called recover1.txt and copy the following text into it:
md tmp
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
delete c:\windows\system32\config\system
delete c:\windows\system32\config\software
delete c:\windows\system32\config\sam
delete c:\windows\system32\config\security
delete c:\windows\system32\config\default
copy c:\windows\repair\system c:\windows\system32\config\system
copy c:\windows\repair\software c:\windows\system32\config\software
copy c:\windows\repair\sam c:\windows\system32\config\sam
copy c:\windows\repair\security c:\windows\system32\config\security
copy c:\windows\repair\default c:\windows\system32\config\default
  • Create a text file called recover2.txt and copy the following text into it:
    del c:\windows\system32\config\sam
    del c:\windows\system32\config\security
    del c:\windows\system32\config\software
    del c:\windows\system32\config\default
    del c:\windows\system32\config\system
    copy c:\windows\tmp\software c:\windows\system32\config\software
    copy c:\windows\tmp\system c:\windows\system32\config\system
    copy c:\windows\tmp\sam c:\windows\system32\config\sam
    copy c:\windows\tmp\security c:\windows\system32\config\security
    copy c:\windows\tmp\default c:\windows\system32\config\default
  • Copy the text files onto a floppy disk.

 

Run batch file 1:

  • Insert the Windows XP CD-ROM into the CD-ROM drive, and then restart the computer (you need to ensure that in the bios, CDROM is first in the boot sequence). Click to select the option that starts the computer from the CD-ROM drive.
  • When the "Welcome to Setup" screen appears, press R to start the Recovery Console.
  • Select the installation that you want to access from the Recovery Console (normally C:\windows )
  • Type the Administrator password (if there is no administrator password, just press ENTER)
  • Copy recover1.txt from the floppy disk to the c:\windows directory.
  • At the command line, type:    batch recover1.txt  (or type the text as shown above)
  • Type exit to quit Recovery Console. Your computer will restart

 

Copy Registry Files:

  • Start Windows XP Home Edition in Safe mode.
  • Open Windows Explorer.
  • On the Tools menu, click Folder options.
  • Click the View tab.
  • Under Hidden files and folders, select Show hidden files and folders, and then deselect the Hide protected operating system files (Recommended) check box.
  • Click Yes in the dialog box that confirms that you want to display these files.
  • Double click on C:\System Volume Information folder. This folder appears dimmed because it is set as a hidden folder.

If you receive the following error message:  C:\System Volume Information is not accessible. Access is denied, then see the following article from Microsoft: http://support.microsoft.com/kb/309531/

  • The C:\System Volume Information folder contains one or more _restore  folders such as "_restore{60E74019-72C2-4BE9-83ED-F1D39F60C196}". Double click on one the the folders.
  • View the details of the folders and open one of the RPnnn folders that does not have the current date.
  • Double click on the snapshot folder.
  • From the Snapshot folder, copy the following files to the c:\windows\tmp folder:
    _REGISTRY_USER_.DEFAULT
    _REGISTRY_MACHINE_SECURITY
    _REGISTRY_MACHINE_SOFTWARE
    _REGISTRY_MACHINE_SYSTEM
    _REGISTRY_MACHINE_SAM
  • Rename the files in the c:\windows\tmp folder as follows:
Rename _REGISTRY_USER_.DEFAULT to DEFAULT
Rename _REGISTRY_MACHINE_SECURITY to SECURITY
Rename _REGISTRY_MACHINE_SOFTWARE to SOFTWARE
Rename _REGISTRY_MACHINE_SYSTEM to SYSTEM
Rename _REGISTRY_MACHINE_SAM to SAM

 

Run batch file 2:

  • Insert the Windows XP CD-ROM into the CD-ROM drive, and then restart the computer (you need to ensure that in the bios, CDROM is first in the boot sequence). Click to select the option that starts the computer from the CD-ROM drive.
  • When the "Welcome to Setup" screen appears, press R to start the Recovery Console.
  • Select the installation that you want to access from the Recovery Console (normally C:\windows )
  • Type the Administrator password (if there is no administrator password, just press ENTER)
  • Copy recover2.txt from the floppy disk to the c:\windows directory.
  • At the command line, type:    batch recover2.txt   (or type the text as shown above)
  • Type exit to quit Recovery Console. Your computer will restart

Note This procedure assumes that Windows XP is installed to the C:\Windows folder. Make sure to change C:\Windows to the appropriate windows_folder if it is a different location.

 

webGFX Button                     webGFX Button