Fixing the Windows Bootloader via the setup DVD
Step Zero: Scan the disk
From the menu, choose the “Launch command prompt” option.
We will use the command line feature to a run a filesystem scan, designed to find and fix problems affecting data integrity and reads/writes from/to the disk, that can be caused by viruses, hardware failures, unsafe shutdown, power surges, and more.
Once the command prompt has launched, execute the following command:
chkdsk C: /f exit
Note that you may need to replaced
C:
with a different letter if it complains that the partition was not found.Attempt One: Automated Repair
Clicking on the “Attempt automated repair…” text with the green arrow at the top of the screen will cause the recovery CD to attempt to repair your bootloader and boot menu.
Assuming your boot files have not been too badly corrupted, this step should conclude with a “Issues resolved” message and prompt you to reboot. It could literally be this easy to fix your PC.
If the automated repair feature is not successful, or after rebooting you discover that your PC still does not work, read on.
The Automated Repair only fixes one thing at a time, and you might need several things fixed (MBR, bootmgr, boot folder). So boot from the recovery CD again and repeat the whole process.
Attempt Two: Manually Repairing the Windows Bootloader
Desperate times call for desperate measures.
This time, we’re going to select the “Launch command prompt” option and try to manually tell the Recovery Console what needs to be fixed. Chances are, this is as far as you’ll have to go; hopefully it’ll get the job done.
Go ahead and select “Command Prompt” from that list, and you should get a window not dis-similar to the one you see when run cmd.exe from Windows.
Let’s start by telling the recovery console to fix our MBR and bootsectors:
bootrec.exe /fixmbr bootsect.exe /nt60 all /force
Then ask it (nicely!) to try and rebuild your BCD data from scratch:
bootrec.exe /rebuildbcd
If you’re lucky, this’ll work and you’ll see a message telling you everything went OK.
Reboot your PC and try booting back into Windows to see if it worked. Don’t forget to remove your Windows Vista DVD or Recovery DVD from the drive, or you’ll end back in the repair center!
Attempt Three: Nuclear Holocaust
Back at the main page of the recovery center, go ahead and select “Command Prompt” yet again from that list.
The first order of business is to make sure the MBR and bootsector contain the right references to the Windows bootloader:
bootrec.exe /fixmbr bootsect.exe /nt60 all /force
Now we get rid of the old BCD registry, and create a new one instead.
Note: We’re assuming that the boot drive is drive C: below. If your computer is configured differently, be sure to use the appropriate drive letter here instead.
attrib -h -s C:\boot\BCD del C:\boot\BCD bcdedit /createstore c:\boot\bcd.temp bcdedit.exe /store c:\boot\bcd.temp /create {bootmgr} /d "Windows Boot Manager" bcdedit.exe /import c:\boot\bcd.temp bcdedit.exe /set {bootmgr} device partition=C: bcdedit.exe /timeout 10 attrib -h -s C:\boot\bcd.temp del c:\boot\bcd.temp
The first two commands may fail. Assuming you entered them correctly, that is fine; it simply indicates the BCD does not yet exist.
Now we have a clean, working Windows bootloader. But we need to add a Windows entry to it:
bcdedit.exe /create /d "Microsoft Windows" /application osloader
bcdedit.exe should return a message with a GUID for the newly-created entry, something like this:
The entry
{c0dfc4fa-cb21-11dc-81bf-005056c00008}
was successfully created.
You’ll need to use the value that bcdedit.exe returned for you below, along with the drive letter for the drive that Windows is installed to:
Again, make sure to replace
C:
with whatever the correct drive is for your Windows Vista/7/8 installation.bcdedit.exe /set {c0dfc4fa-cb21-11dc-81bf-005056c00008} device partition=C: bcdedit.exe /set {c0dfc4fa-cb21-11dc-81bf-005056c00008} osdevice partition=C: bcdedit.exe /set {c0dfc4fa-cb21-11dc-81bf-005056c00008} path \Windows\system32\winload.exe bcdedit.exe /set {c0dfc4fa-cb21-11dc-81bf-005056c00008} systemroot \Windows
And, last of all, tell the bootmgr bootloader to list the new entry or else it’ll remain hidden:
bcdedit.exe /displayorder {c0dfc4fa-cb21-11dc-81bf-005056c00008}
Now your bootloader has been completely removed and rebuilt from scratch. If you got this to work, feel free to consider yourself one of the finest graduates of the NeoSmart Technologies Institute of BCD Learning.
At this point, you have a clean, untouched, and (hopefully) fully-working bootloader with one entry for Windows.
Go ahead and reboot your PC, get back into Windows, and use EasyBCD to further tweak the bootloader to your heart’s content.
We advise backing up the BCD registry immediately with EasyBCD before making any changes.
Comments
Post a Comment