What is the equivalent command for bcdboot in bcdedit?

Making a new boot entry for Windows 7/8 (for dual boot) can apparently be done very easily with bcdboot. For example (see here):

bcdboot D:\windows

Now, reading through forums I find people using bcdedit for more complex booting, like booting from VHD and such.

So I assume there is an equivalent command(s) in bcdedit for bcdboot D:\windows, but I am not sure which. Knowing what bcdboot does in terms of bcdedit would surely help me understand bcdedit better.


Solution 1:

It's been more than a few years, and even now with Windows 10 the BCDEDIT program remains as mysterious as before. Slightly more than a year ago, I had to learn about BCDEDIT the hard way and I didn't have the faintest idea how BCDEDIT or BCDBOOT was supposed to work. To answer your question, if BCDBOOT can be used to create the template to make a bootable Windows entry in the BCD, then BCDEDIT can probably do the same with a lot more commands and typing, as follows:-

C:\>bcdedit /create /application OSLOADER The entry {43083ab0-6bcd-11e8-a9c7-9cb70d586adc} was successfully created.

If you check inside your BCD to find that particular {ID} which was created, then you will see the following:-

C:\>bcdedit /enum {43083ab0-6bcd-11e8-a9c7-9cb70d586adc} Windows Boot Loader identifier {43083ab0-6bcd-11e8-a9c7-9cb70d586adc}

You would be right to think that there appears to be a lot of information missing for a proper Windows Boot Loader entry in the BCD. The full entry should look something like the one that was created when you first installed Windows, as follows:-

C:\>bcdedit /enum {current} Windows Boot Loader identifier {current} device boot path \WINDOWS\system32\winload.exe description Windows 10 Pro 64-bit locale en-US inherit {bootloadersettings} recoverysequence {d3150567-fac9-11e7-a6a0-d6a823273fc8} displaymessageoverride Recovery recoveryenabled Yes allowedinmemorysettings 0x15000075 osdevice boot systemroot \WINDOWS resumeobject {fbe9c9e8-fa42-11e7-a9a1-9cb70d586adc} nx OptIn bootmenupolicy Legacy

So in this case, you are now faced with a lot of typing required, as I would think that at the very minimum, your Windows Boot Loader entry must have "identifier", "device", "path", "description" "osdevice" and "systemroot". Therefore, you will now have to type something like the following:-

C:\>bcdedit /set {43083ab0-6bcd-11e8-a9c7-9cb70d586adc} device <whichever partition this particular Windows installation is located> C:\>bcdedit /set {43083ab0-6bcd-11e8-a9c7-9cb70d586adc} path <wherever the WINLOAD.EXE file for this particular Windows installation is located in> C:\>bcdedit /set {43083ab0-6bcd-11e8-a9c7-9cb70d586adc} description "<give a name here, if you use spaces then the entire phrase must be enclosed in quotes>" C:\>bcdedit /set {43083ab0-6bcd-11e8-a9c7-9cb70d586adc} osdevice <whichever partition this particular Windows installation is located> C:\>bcdedit /set {43083ab0-6bcd-11e8-a9c7-9cb70d586adc} systemroot <whichever folder the particular Windows installation is located in>

Lastly, you will need to modify the {bootmgr} entry to allow a choice of operating systems, by typing the following commands:-

C:\>bcdedit /set {bootmgr} timeout 5 C:\>bcdedit /set {bootmgr} displaybootmenu Yes C:\>bcdedit /displayorder {43083ab0-6bcd-11e8-a9c7-9cb70d586adc} /addlast

More information here:-

Adding Boot Entries | Microsoft Docs

Solution 2:

Extending on what I said in comment, both bcdboot and bcdedit are slightly different tools. They are not used for the same purposes and, as they rely only on the contents stored in the BCD (Boot Configuration Data), they are independent.

bcdboot can be best described as "the bootloader installer guy". It can be used to set up the bootloader for existing Windows partitions (whether they are to be installed, run from a VHD, or already installed).

This is done by copying some files that exist in the /Windows directory to a specific location and updating the Master Boot Record in order for it to point to the bootloader.

bcdedit is a more complex tool, designed to edit the BCD information. Think of it as "the editor guy". One of the possible reasons why many people in the Internet use it in favor of bcdboot is that most dual or multi-booting systems aren't linear and may have several different scenarios that the generic bcdboot doesn't cover.

A good example of this is dual-booting Windows XP and 7. As XP doesn't have BCD files, bcdboot wouldn't work on it. It might also not be recognized by the latest systems's bootloaders off the box.

bcdedit is a quite hefty tool, so some people made tools in order to edit the BCD data from Windows. One of which is EasyBCD, which enables you to see and edit manually the BCD configuration and add effortlessly new partitions. As of now, the free version suits most user's needs quite well.

They also made a tutorial about how to recover the BCD-based bootloader from the Windows installation disk, which is one of the reasons why I mention the product. If you read it, there is one method (the Nuclear Holocaust) that can be used with bcdedit in order to restore the bootloader. bcdedit only writes the correct entries into the bootloader, so that you can actually boot into your systems.