Posts Tagged ‘XP registry corrupted.’

Repairing Windows XP using the Recovery Console

March 13th, 2011 No comments

NOTE:This solution is only for solving the errors and issues given below, if the computer is not infected by spyware and viruses. The commands given below may rebuild even some heavily infected computers, but there’s no such guarantee. If you doubt that your computer is infected, remove the spyware and viruses first, before trying this procedure.

Many people turn off their computers at night, all over the world, but some people, after turning them on, the next morning, get an error screen instead of the Starting Windows XP screen. The error can be any one of the following, in addition to others:

Windows could not start because the following file is missing or corrupt:


You can attempt to repair this file by starting Windows Setup using the original Setup CD-ROM.

Select ‘R’ at the first screen to start repair.

Windows could not start because the below file is missing or corrupt:


Windows could not start because the below file is missing or corrupt:


NTLDR is missing.

Press any key to restart


Invalid boot.ini.

Press any key to restart

Now, your computer doesn't boot in the normal way, so you try booting it using the safe mode. But, you still get the same error message. If you are somewhat knowledgeable and know about the recovery console, you boot into the recovery console and try the FIXBOOT and FIXMBR commands but these too don't help. You want access to some critical data, but how do you access it when Windows won't boot even using the safe mode?

If you call a computer technician, he would most probably tell you that the only solution to these errors is to backup your data by connecting the hard disk to another computer and then reinstalling Windows from scratch. Then, installing and configuring your software programs and restoring your data back. A very cumbersome process and it can take many weeks or even months to configure all your Windows and software settings, the way they were previously. Apart from the time and trouble this would take, you also have to spend a hefty amount for his work.

So, how do you troubleshoot and repair the above errors yourself? Continue reading below.

First, boot into the Recovery Console, using the Windows XP installation CD, or if you have the Recovery Console installed on your hard disk and available as an option in the Windows boot menu, use that.

Most people would have just one Windows installation. However, if you have more than one, select the one that gives the above errors. Once you are in the Recovery Console, type the commands in sequence, given in step 7.

The BOOTCFG /Rebuild command fixes the following:

  • Windows Hardware Abstraction Layer (HAL)
  • Corrupt registry hives (\WINDOWS\SYSTEM32\CONFIG\xxxxxx)
  • Invalid BOOT.INI file
  • A corrupt NTOSKRNL.EXE
  • A missing NT Loader (NTLDR)
    The repair process is harmless and may or may not apply to other types of errors and blue screens of death (BSOD), but it’s not guaranteed and xpdrivers won’t be responsible for any harm, it may cause.
  1. After ensuring that the computer BIOS is set to boot from the CD drive first, boot your computer with your Windows XP installation CD in the CD drive. If you don’t know how to set the BIOS to boot the computer from the CD, view this page.

    The following YouTube videos would also be helpful:

  2. After the computer boots and Windows XP Setup starts, do not select the option which says: "Press F2 to initiate the Automated System Recovery (ASR) tool." Let the Setup proceed till you see the following screen. At this screen, press the letter "R" on your keyboard, to start the Recovery Console.


  3. After pressing the letter R, the Windows XP Setup prompts you to select a valid Windows installation (this would mostly be number "1"). Select the installation number ("1" in most cases) and hit the Enter key. If you had set an administrator password during the initial Windows XP installation, type the password and then hit enter.
  4. If you don’t remember the administrator password, or don’t remember if you had set one or not, try pressing the enter key instead of typing any password. This could work in many cases. 

    But, what to do if the recovery console doesn’t accept a blank password and if you don’t remember the one you had set during installation? Click here to know more, how to recover or reset your Windows XP password with some free tools.

    Once, the Setup accepts the password, it greets you with the following screen, which tells you that the recovery console is ready to accept commands:


  5. There are seven commands which you have to type one by one in sequence to repair any of the above mentioned errors. Type one command per line and hit the enter key after typing each. Remember to replace the drive letter (C: in this case), with the appropriate drive letter for your Windows installation. The commands are:
    • CD .. or CD \
    • ATTRIB –RSH C:\boot.ini
    • COPY C:\boot.ini C:\boot.bak
    • DEL C:\boot.ini
    • BOOTCFG /Rebuild
    • CHKDSK /R
  6. The first command, CD .. (or CD \) brings you out of the Windows directory, into the root directory, C:.


  7. Once you’re at the C:\> prompt, you can start repairing XP. First of all, you have to change the attributes of the boot.ini file, which is hidden from normal view. BOOT.INI controls what operating systems the Windows boot process can see, how to load them, and where they’re located on your hard disk. Type the below command at the command prompt and press the enter key. to remove the system, hidden and read-only attributes of boot.ini:

    ATTRIB -RSH C:\boot.ini

  8. After removing the attributes with the above command, make a backup of boot.ini, using the ‘copy’ command. Then, delete the original boot.ini, using the ‘del’ command, as shown below.


  9. The BOOTCFG / REBUILD is the most important of all the commands. It searches for existing Windows XP installations, rebuilds essential Windows’ components, recompiles the BOOT.INI file and corrects many common Windows’ errors.

    There are two important steps in this command:

    • You must use the /FASTDETECT as an option to the BOOTCFG command, when the command asks for an OS Load Option.
    • If you have a CPU with the Intel’s XD or AMD’s NX buffer overflow protection, you must also use /NOEXECUTE=OPTIN as an OS Load Option, as shown below. Do not put NOEXECUTE as an OS Load Option if your CPU doesn’t have the Intel’s XD or AMD’s NX buffer overflow protection.
    • For the identifier, you can type "Microsoft Windows XP Home Edition", if you have Windows XP Home Edition, for example.Recovery_Console_bootcfg_command
  10. This command checks and fixes any physical errors on the partition containing Windows XP. This is just a simple command, type it at the C:\> prompt:


    The command can take some time to complete, especially if there are some errors, as it has to check the whole partition. If you don’t learn or understand how to use any other Recovery Console commands, learn this one for sure. In many cases, this single command has fixed computers which wouldn’t boot into Windows. After the command finishes, move on to the last step.

    Recovery_Console_chkdsk_command Recovery_Console_chkdsk_report

  11. This is also a simple command. Just type FIXBOOT at the C:\> prompt. This command writes a new boot sector to the hard drive. Press "Y" when the command asks if you want to write a new boot sector to partition C:, and press the Enter key to confirm.


  12. The procedure is complete and you can type the command, EXIT, followed by pressing the Enter key, to reboot the computer. If you are lucky, the computer should boot into Windows XP as if nothing had happened. If you were successful in booting into Windows XP, you saved yourself a lot of headache, frustration, data loss and paying big bucks to a computer technician.

Windows XP Crash Recovery – When all else Fails

January 21st, 2011 1 comment

WARNING: Do not use the procedure described in this post, if your computer has an OEM-installed operating system (Dell, HP, Compaq, etc). The system hive on OEM installations creates user accounts and passwords that were not there previously. If you use the procedure described in this post, you may not be able to log back into the recovery console to restore the original registry hives.


  • This post assumes that you have tried other recovery methods and still can’t access the system, except by using Recovery Console. If you haven’t tried other methods of recovery yet, try them first. Click here to know a few other methods of recovery, before you try this method. However if you’ve already tried the other methods, go ahead and try the one mentioned below.
  • Make sure to replace all five registry hives. If you replace only a single hive or two, this can cause problems because software and hardware may have settings in more than one location in the registry.
  • 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 in a different location.

Since your Windows already crashed, you’re probably viewing this post on another computer. It’s better if you take a printout of this post, because you’ll have to type many commands to recover your corrupted Windows XP installation. Even if you don’t have to type them, it’s better to have a printout. If you don’t want to print the images, here’s a text-only version of this post.

It’s possible that somehow your Windows registry is corrupt. But there is a backup of the registry! Since Windows doesn’t start, we’ll have to restore this backed up registry files, manually. How do you do that? Follow the procedure detailed below.

1. Boot the computer with your Windows XP CD in the drive. If you see a message like "Press any key to boot from CD …", go ahead and press a key on your keyboard.


2. If you don’t see any such message or if your computer doesn’t boot from the CD, go into your BIOS/CMOS setup, by rebooting the computer and pressing the appropriate key (like F1, F2, F10, DEL, etc).


3. If you don’t even see the message to press the above keys to enter the BIOS setup, read your motherboard manual on how to enter the BIOS setup. These videos about BIOS and CMOS may be helpful too:

4. Now, when booting from the XP CD, when you see the Welcome to Setup screen, press R to start the Recovery Console.


5. You will see the following screen. Type 1 and press the Enter key. You’ll have to enter the Administrator password. If you didn’t set a password, when you installed Windows XP, just press the Enter key.


NOTE: If you have access to another computer, to save time, you can copy the text in step six and seven, and paste it in a text file called "Regcopy1.txt" (for example). You can also download this text file and save it on a USB pen drive, before you run the below command. To use this file, run the following command when you start in Recovery Console:

batch regcopy1.txt

To know, how to access files on other drives when in the recovery console (USB pen drive, for example), type the following three commands, one per line, and press the Enter key after each command (make sure to type the space on both sides of the equal sign):

AllowWildCards = TRUE
AllowAllPaths = TRUE
AllowRemovableMedia = TRUE

6. Now type the commands you see below, one per line and then press the Enter key, after each command:

md c:\tmp
copy system c:\tmp\system.bak
copy software c:\tmp\software.bak
copy sam c:\tmp\sam.bak
copy security c:\tmp\security.bak
copy default c:\tmp\default.bak
del system software sam security default

After you enter each of the above copy commands, the system will reply with a message like "1 file(s) copied".

7. Now, type this set of commands, one per line and press the Enter key after each (Take care to type the space and the dot as shown):

copy c:\windows\repair\system .
copy c:\windows\repair\software .
copy c:\windows\repair\sam .
copy c:\windows\repair\security .
copy c:\windows\repair\default .

8. Now type exit and press the Enter key. The system will reboot.

9. Remove the CD from the drive and boot into Windows normally, as you do before. If, even after doing each of the above steps correctly, Windows doesn’t boot, you’ll have to do a clean install of Windows, after taking a backup of your data. There is no other way to recover.

But, the question is – How do you take a backup of a computer which doesn’t even boot or start Windows? Click here to read more on this topic and backup your computer before you format the hard drive or reinstall Windows from scratch.

However, if the system boots into Windows, then do the following:

a. Start Windows Explorer. On the Tools menu, click Folder Options and then click the View tab.


b. Under Hidden Files and Folders, select the radio button "Show Hidden Files and Folders", and then clear the "Hide Protected Operating System Files (Recommended)" check box. Also clear the "Use Simple File Sharing (Recommended)" checkbox. This is the last checkbox under the Advanced settings, so you’ll have to scroll down.

c. Click Yes when a dialog box is displayed. Then, click OK to close Folder Options.

d. Now, check whether you have an NTFS or a FAT32 file system. How do you check if you have NTFS or FAT32 file system? In My Computer or Windows Explorer, right-click the C drive (or your Windows drive, if other than C) and then click Properties.


e. If the file system on C drive is NTFS, Windows won’t let you open this folder, but there’s a solution. Under the C drive, right-click on the System Volume Information folder and select Properties. In the drive properties, click the Security tab. Click the Add button, and then in the box that’s labeled "Enter the object names to select", type the username that you use to log on to Windows. This is shown in the image below.

If your file system is FAT32, you don’t have to do anything like the above. You can access the System Volume Information folder without any problems.


f. Now, open the System Volume Information folder. This folder appears dimmed, that’s fine.

g. This folder contains some _restore {GUID} folders such as "_restore{87BD3667-3246-476B-923F-F86E30B3E7F8}". Open a folder that was created before the current date and time. You may have to click Details on the View menu to check this.

h. There may be one or more folders starting with the name "RP x", under this folder. These are the restore points. Open one of these folders to locate a Snapshot subfolder.


i. The following path is an example of a folder path to the Snapshot folder:

C:\System Volume Information\_restore{D86480E3-73EF-47BC-A0EBA81BE6EE3ED8}\RP1\Snapshot

j. From the Snapshot folder, copy the following files to the C:\tmp folder with the mouse (by Ctrl-clicking them):



k. Rename the above five files as given below (using the mouse or the F2 function key):

_registry_user_.default        default
_registry_machine_security     security
_registry_machine_software     software
_registry_machine_system       system
_registry_machine_sam          sam

l. Once again, put your Windows XP installation CD into your CD Drive and reboot the computer.

m. Again, press R for the recovery console when you see the message for recovery, just like you did in step 4 above.

NOTE: If you have access to another computer, to save time, you can copy the text commands in step n, and paste it in a text file called "Regcopy2.txt" (for example). You can also download this text file and save it on a USB pen drive, before you run the below command.To use this file, run the following command when you start in Recovery Console:

batch regcopy2.txt

n. At the console, type these commands one per line and press enter after every command (take care to type the dots exactly as shown in each command):

del sam security software default system
copy c:\tmp\software .
copy c:\tmp\system .
copy c:\tmp\sam .
copy c:\tmp\security .
copy c:\tmp\.default .

o. Now, type exit and remove the CD. Boot normally into Windows and you must be back to normal. In case, the restore point is not the one which you wanted, you can use the System Restore to restore a different restore point. This time you are already in Windows so you don’t have to use the recovery console. For more information, how to use the System Restore in Windows XP, click here.