How to Fix Windows 7 and Vista When It Fails to Boot

Note: If you wish to try the Startup Repair option first, it is often successful in automatically fixing many different start up issues, but in this article we will be using the Command Prompt

Error loading operating system

Missing operating system

Invalid partition table


In Windows 7 and Vista, the procedure to fix the master boot record is a bit different compared to XP. You have to start up Vista in the Recovery Environment and then run the bootrec command. Here’s how.

1. First, load up the Windows Vista disc in your drive and press any key to boot from the disc.

2. Choose the language, time, currency, etc and click Next.



3. Now click on Repair Your Computer.



4. Choose the operating system to repair and click Next.


Note: You have no OS to select? Solution select install instead of repair and it will detect your drive, select cancel and go back to the repair section, your OS will show up now.




5. When the System Recovery Options dialog comes up, choose the Command Prompt.



6. Type the following into the "Command Prompt Window":

bootrec.exe /fixmbr

This will rebuild the boot configuration data and hopefully fix your problem. You can also run the command with switches to fix just the master boot record (/fixmbr), the boot sector (/fixboot), or rebuild the entire BCD (/rebuildbcd).
(for example)

bootrec.exe /fixmbr
bootrec.exe /fixboot
bootrec.exe /rebuildbcd



Fixing the Master Boot Record (MBR) in Windows 7

1. Turn your computer on, booting from either your Windows 7 Installation DVD or Windows 7 System Recovery Disc.  Note: You may need to change the boot order inside your BIOS to have the your DVD drive boot first.

2. After the installation or recovery disc loads, if prompted, select your language settings and then continue.  If you are using the installation DVD, when prompted by the following screen select Repair your computer.



3. The computer will take a moment now to scan itself for any Windows installations, after which you will likely be given a choice to select which installation you wish to repair.  Select the appropriate Windows installation from the list and then continue. If by chance a problem is detected in one of your Windows installations at this initial stage, the system may also ask you if it can try to repair the problem automatically. It is up to you if you wish to let the system try to repair itself, but otherwise just select No.




Note: You have no OS to select? Solution select install instead of repair and it will detect your drive, select cancel and go back to the repair section, your OS will show up now.


4. Once you have reached the System Recovery Options screen, as shown below, you will be faced with a list of choices that can aid you in repairing a damaged Windows 7 operating system.  If you wish to try the Startup Repair option first, it is often successful in automatically fixing many different start up issues, but in this article we will be using the Command Prompt option to resolve our problems manually. So, click Command Prompt to continue.



Step five: Now sitting at the command prompt, enter the following command and then press enter:

bootrec.exe /FixMbr

If successful, you should be greeted with the message The operation completed successfully. That’s it!  Your Master Boot Record has been repaired.

While the above command does fix the MBR, and sometimes that is enough, there still might be an error with the system partition’s boot sector and Boot Configuration Data (BCD). This might occur if you have tried to install another operating system alongside Windows 7, such as Windows XP.  To write a new boot sector, try the following command:

bootrec.exe /FixBoot

If you are still faced with your Windows 7 installation not being detected during start up, or if you wish to include more than one operating system choice to your system’s boot list, you can try the following command to rebuild your BCD:

bootrec.exe /RebuildBcd

The above command will scan all your disks for other operating systems compatible with Windows 7 and allow you to add them to your system’s boot list. If this fails, you may need to backup the old BCD folder* and create a new one in its place with the following commands:

bcdedit /export C:\BCD_Backup
c:
cd boot

attrib bcd -s -h -r

ren c:\boot\bcd bcd.old

bootrec /RebuildBcd


*Some users also find simply deleting the boot folder and retrying the above steps effective at resolving boot issues, but it is not recommended.