Bienvenido! - Willkommen! - Welcome!

Bitácora Técnica de Tux&Cía., Santa Cruz de la Sierra, BO
Bitácora Central: Tux&Cía.
Bitácora de Información Avanzada: Tux&Cía.-Información
May the source be with you!

Thursday, September 30, 2010

bcdedit.exe and bootrec.exe

BCDEDIT - How to Use
 X:\Sources>bootrec /rebuildbcd
> Scanning all disks for Windows installations.
> Please wait, since this may take a while...
> Successfully scanned Windows installations.
> Total identified Windows installations: 1
> [1] C:\Windows
> Add installation to boot list? Yes(Y)/No(N)/All(A):Y
> *Element not found.*
> So what's 'Element not found.'?

The element not found is when the rebuild tool is unable to detect the installation presently on the system. That can be for different reasons like the order you type the commands in. Try typing the bootrec /scanos entry before using the bootrec /rebuildbcd. Once successfully added you simply type the bootrec /fixmbr and /fixboot commands.

Another option if the BCD store itself isn't able to be rebuilt is to delete the present one. The second section seen on the MS page for this is at 'Error message when you start Windows Vista: "The Windows Boot Configuration Data file is missing required information"'
The easier commands to use at the command prompt are:

(c:) ????

bcdedit /export C:\BCD_Backup (C being used here for the single OS/system drive)
cd boot
attrib bcd -s -h -r
ren c:\boot\bcd bcd.old
bootrec /RebuildBcd

bootrec /fixmbr
bootrec /fixboot

Use the WinPe setting in EasyBCD.
EasyBCD 2.2 - The NeoSmart Forums

Attached Thumbnails
Boot from .wim?-capture.jpg

Let's start by telling the recovery console to fix our MBR and bootsectors:
Replace x: in the commands below with the letter to your CD drive as detected by the Windows Recovery environment
bootrec.exe /fixmbr
x:\boot\bootsect.exe /nt60 all /force
Then ask it (nicely!) to try and rebuild your BCD data from scratch:
del C:\boot\bcd
bootrec.exe /rebuildbcd
If you're lucky, this'll work and you'll see a message telling you everything went OK.
Reboot your PC by typing in this command or by closing all the dialogs:
shutdown -r -t 0
Don't forget to remove your Windows Vista DVD or Recovery DVD from the drive!

Step Four: Nuclear Holocaust

Windows Vista doesn't have its share of haters for no reason: when the going gets tough, the tough gets going.
So Windows Vista can't even fix itself - god, that's what we love about EasyBCD! If you were in Windows Vista right now, you could have used EasyBCD's "Reset BCD Data" feature to have EasyBCD actively search for any and all discrepancies in your bootloader, zero out your old BCD data, and re-create it all from scratch. But you're not and it's no use lamenting what you could be doing with our super-cool app if you can't even use it in the first place now, is it? 
Go ahead and select "Command Prompt" yet again from that list. Roll up your sleeves, and prepare to be tortured.
The first order of business is to make sure the MBR and bootsector contain the right references to the Vista bootloader:
Replace x: in the commands below with the letter to your CD drive as detected by the Windows Recovery environment
bootrec.exe /fixmbr
x:\boot\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.
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
del c:\boot\bcd.temp
Now we have a clean, working Vista bootloader. But we need to add a Vista entry to it:
bcdedit.exe /create /d "Windows Vista" /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 Vista is installed to:
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 Vista bootloader to boot the new entry by default:
bcdedit.exe /displayorder {c0dfc4fa-cb21-11dc-81bf-005056c00008}
bcdedit.exe /default {c0dfc4fa-cb21-11dc-81bf-005056c00008}
Now the Vista bootloader has been nuked 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 Vista. Go ahead and reboot your PC, get into Windows Vista, 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.
creating a 2 OS thumb drive

No comments: