Build A Bootable BCD From Scratch With Bcdedit
Build A Bootable BCD From Scratch With Bcdedit
Build A Bootable BCD From Scratch With Bcdedit
These commands work whether you already have a \boot\bcd in place or if youre working
from a toasted boot volume that lacks any BCD file at all. Now that youve done that, the
sacrificial" BCD file is no longer necessary, so you can delete it:
del bcd
Next, create the Boot Manager piece of the BCD file by typing
bcdedit /create {bootmgr}
Note the /create option in this command instead of the /createstore option in the earlier
command. Youll use the former quite often in BCD work and the latter much less so. The
/create option lets Bcdedit create several different kinds of BCD objects. Invoking it with the
{bootmgr} identifier creates that overall Boot Manager section. (Note that I haven't included a
description with the /d option, despite the fact that every example I can find on the Web does.
Its superfluous when creating a Boot Manager object.)
The Boot Manager doesnt need much tweaking, but it does need to know what volume to
boot from and how many seconds to wait for a user to choose an OS option. These options
will work fine:
bcdedit /set {bootmgr} device boot
bcdedit /timeout 30
Next, create the OS entry object that will tell the Boot Manager to boot Windows from files in
the \Windows folder on one of the systems volumes. That volume is usually C, but if youre
booted from Windows Preinstallation Environment (WinPE), double-check which drive has
the \Windows folder on itWinPE might see it as D or E. (Thatll be important in a minute.)
Now, create the OS entry object:
bcdedit /create /d "Windows 7" /application osloader
The /create option (without an ID) and the /application osloader option tell Windows that
youre creating an OS entry for a Vista-and-later version of Windows. (The /d option contains
the label that Boot Manager shows when offering multiple OS entries.) That returns a new
GUID that you should plug into this next command:
bcdedit /default {<GUID>}
At this point, youve got a naked object that needs some values with the Bcdedit /set
command that I introduced in earlier Bcdedit columns, but what to set those values to?
Simple! Look at the output of Bcdedit on a healthy copy of Windows, and use it as a model.
In my case, the \Windows folder is on drive D, so I entered these:
bcdedit
bcdedit
bcdedit
bcdedit
bcdedit
/set
/set
/set
/set
/set
{default}
{default}
{default}
{default}
{default}
device partition=d:
path \windows\system32\boot\winload.exe
osdevice partition=d:
systemroot \Windows
detecthal yes
Finally, add this command, or Windows wont see the OS entry properly:
bcdedit /displayorder {default} /addlast
Give this a try with a test machine or two, and youll be Doctor Boot in no time!