37

Short Version

What are the bcdedit commands necessary to setup dual boot between different installations of Windows?5

Long Version

I recently installed Windows 8 onto a separate hard drive1. Now that Windows 8 in installed I want to dual-boot back to Windows 7.

I have my two2 hard drives:

Windows partition manager screenshot

So you can see that I have my two disks, with the partitions containing Windows:

  • Windows 7: \\PhysicalDisk0 (partition 03)
  • Windows 8: \\PhysicalDisk2 (partition 1)

What I'm trying to figure out how is how to use bcdedit to instruct the thing that boots Windows that there is another Windows installation out there.

Running bcdedit now, it shows current configuration:

C:\WINDOWS\system32>bcdedit

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume2
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
integrityservices       Enable
default                 {current}
resumeobject            {ce153eb7-3786-11e2-87c0-e740e123299f}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \WINDOWS\system32\winload.exe
description             Windows 8
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {ce153eb9-3786-11e2-87c0-e740e123299f}
integrityservices       Enable
recoveryenabled         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \WINDOWS
resumeobject            {ce153eb7-3786-11e2-87c0-e740e123299f}
nx                      OptIn
bootmenupolicy          Standard
hypervisorlaunchtype    Auto

I cannot find any documentation on the difference between Windows Boot Manager and Windows Boot Loader.

Research Effort

There is some documentation on Bcdedit:

But they don't explain how to edit the binary boot configuration data.

If I had to guess, I would think that a Windows Boot Manager instructs the BIOS what program it should run. That program would give the user a set of boot choices. That leaves Windows Boot Loader do be a particular boot choice, that represents a particular installation of Windows.

If that is the case I would need to create a new Windows Boot Loader entry.

This means I might want to use the /create parameter:

/create

Creates a new boot entry:

bcdedit [/store filename] /create [id] /d description [/application apptype | /inherit [apptype] | /inherit DEVICE | /device]

So I assume a syntax of:

>bcdedit /create /d "The old Windows 7" /application osloader

Where application can be one of the following types:

Apptype     Description
BOOTSECTOR  The boot sector application
OSLOADER    The Windows boot loader
RESUME      A resume application

Unfortunately, the only documentation about osloader is "The Windows boot loader". I don't see how that can differentiate between Windows 8 on one hard drive, and Windows 7 on another.

The other possible parameter when /create a boot loader is

>bcdedit /create /D "Windows Vista" /device "The Quick Brown Fox"

Unfortunately the documentation is missing for /device:

/device

Optional. If id is not set to a well-known identifier, the option that is used to specify the new boot entry as an additional device options entry.

Since I did not set id to a well-known identifier, I must set /device to "the option that is used to specify the new boot entry as an additional device options entry". I know all those words; they're all English. But I have no idea what it is saying; those words in that order seem nonsensical.

So I'm somewhat stymied. I don't want to be like Dan Stolts from Microsoft, who destroyed his hard drives trying to use BCDEdit:

I found no content that was particularly helpful when I hosed my machine by playing with BCDEdit. This post would have been ok if there was much more detail especially on the /set command OSDevice, etc. So once I got my machine fixed, I documented the solution and the information is here....

I mean, if a Microsoft guy can't even figure out how to use BCDEdit to edit his BCD, then what chance do I have?

Bonus Reading

Footnotes

  • 1 Since the Windows 8 installer would have damaged my Windows 7 install, I decided to unplug my "main" hard drive during the install. Which is a long-winded explanation of why the Windows 8 installer didn't detect the existing Windows 7 install. Normally the installer would have automatically created the required entries for dual-boot. Not that the reason I'm asking the question is important.
  • 2 Really there's three drives, but the third is just bulk storage. The existence of a 3rd hard drive is irrelevant to the question. I only mention it in case someone wants to know why the screenshot has 3 hard drives when I only mention two.
  • 3 I arbitrarily started numbering partitions at "zero"; not to imply that partitions are numbered starting at zero. I only mention partitions because I don't see how any boot-loader could do its job without knowing which partition, and which folder, an installation of Windows is located in.
  • 4 I'm asking about BCDEdit. I tried Visual BCD Editor. It seems to be a visual BCD editor. That is to say that it's a GUI, but still uses the same terminology as BCDEdit, and requires the same knowledge that BCD doesn't document.
  • 5 For simplicity sake we'll assume that all installation of Windows I want to dual-boot between are Windows Vista or later, making them all compatible with the BCDEdit and the binary boot loader. The alternative would require delving into the intricacies of the old ntloader. Nor am I asking about dual booting to Linux; or how to boot to a Virtual Hard Drive (vhd) image. Just modern versions of Windows on existing hard drives in the same machine.

7 Answers 7

22

This is not a direct answer to the question before "Background" but points to an alternative solution for creating loader entries for booting two (and more) Windows Vista and later OS's. Please see also my second answer below about critic on terminology used in Visual BCD.

No guids, devices, objects, elements and blah, blah, blah.

My Background (skip if not interested and go to solution below):

I have implemented Visual BCD Editor.

During the implementation process I had to read all available sources on bcdedit and WMI BCD Provider interface (programming interface, can be used with C++, C#). The documentation from Microsoft is really poor.

In the BCD there are objects (loaders, settings, device elements). There is no documentation about the connections between objects despite there are dependencies.

There are more than 140 (!) elements (properties) of BCD objects in Windows 7. I do not know the meaning of some elements - there is simply no documentation.

In Windows 8 there are new elements - I guess the total number now is approaching 180 (!!). No documentation.

On the other hand there are two very powerful utilities for manipulating the BCD: bcdboot and reagentc.

bcdboot - creates/fixes default loader also BCD and boot environment as a whole !

reagentc - installs/deinstalls recovery environment (winre.wim)

Both tools are not very well documented also.

Alternative solution:

There is almost no need of bcdedit as using only bcdboot you can create loaders for Windows Vista and later Windows OS's - you create loader for earliest OS, than for the latest and voila you have created the boot environment for a dual/multi boot system:

Assuming you are in Windows 8:

1. bcdboot f:\windows (this maps to Windows 7 as on picture in question)

2. bcdboot c:\windows (this maps to Windows 8)

Done !

Base Microsoft rule for boot process: Boot environment (and BCD) should be always on [first disk + active partition]. (on picture - Disk 2 => First disk in BIOS boot sequence !)

Last but not least there is the bootsect utility for writing MBR and PBR (master and partition boot record) - now standard in Windows 8 (was available only in WinRE earlier).

So using only bootsect and bcdboot all boot entities for a dual boot system can be created/fixed.

I think the boot process for Vista and later is described very well on many internet sites even on Microsoft.com.

Note:

One of the best sites about Windows BCD is Geoff Chappell's site - there is more detailed information there than on Microsoft.com. Interested users could find quite useful information there and some critical notes on bcdedit documentation.

1
  • I totally agree that using BCDBOOT is the most reliable way to add another Windows intallation to BCD. Never had any problem with it and I've done at least 50 such multi boot installations.
    – tst
    Nov 13, 2022 at 22:15
16

When I formatted my C: drive to reinstall Windows the master boot record was deleted and the Windows 7 installer failed to restore it. I could use a GUI bcdedit tool like Visual BCD Edit tool, but why should I have to install something when there should be a simple command in bcdedit can do the job? After much searching through the online help files I gave up with bcdedit and found the answer here buried in digressions. To create a boot entry for the second partition you have to use bcdboot.

Assuming you are in C:\Windows:

  1. bcdboot e:\windows
  2. bcdboot c:\windows
    When you reboot you will be presented with the Windows boot menu with two entries for Windows 7. If you select the entry that boots into C:\Windows you can rename the entry for this partition with:
  3. bcdedit /set {current} description "Windows 7 (Partition 1)"
    This makes the OS booted at startup the default entry in the boot menu:
  4. bcdedit /default {current}
    This places the default OS at startup first item in the boot menu
  5. bcdedit /displayorder {default} /addfirst
    Or you could make the OS at startup the first item in the boot menu:
  6. bcdedit /displayorder {current} /addfirst
    Now reboot and select the second item in the boot menu which should be labelled "Windows 7". Once booted into E:\Windows rename the OS booted at startup:
  7. bcdedit /set {current} description "Windows 7 (Partition 2)"
    Test that the boot menu works OK and save the bcd data to a partition that does not have an OS installed on it:
  8. bcdedit /export D:\Saved_BCD_Settings\SavedBCD
    If you mess anything up later you can restore the bcd boot menu with:
  9. bcdedit /import D:\Saved_BCD_Settings\SavedBCD
5
  • My Motorcycleboy you are just repeating my answer given some month ago. -1.
    – snayob
    Mar 14, 2013 at 7:19
  • @snayob, I value your answers (+1), but Motorcycleboy does go in a bit more detail about commands after one creates the bootentries. Now, something that is missing in this whole discussion is what the equivalent command in bcdedit is for bcdboot e:\windows (see here for the question) Dec 27, 2013 at 12:43
  • 1
    I don't think there is an equivalent of bcdedit commands for "bcdboot e:\windows" as bcdboot copies and repairs the whole boot environment(bootmgr + \boot folder + repairs BCD + adds an entry for the OS specified)
    – snayob
    Jul 13, 2014 at 0:11
  • {current} does not work. Apr 9, 2016 at 18:53
  • @TomilovAnatoliy In PowerShell, you have to quote it: '{current}'. Jan 1, 2023 at 11:08
9

Although old, I want to add to the answers, because several of the answers above contain incorrect information. They probably work, but you certainly don't need an external program, or even bcdboot to do it. For reference the correct information is as follows:

Quick BCD background if new to it

BCD is the Windows boot config. It contains numerous sections, each identified by a name (called the "description") and an identifier that looks a bit like this: "{0743bb44-fda6-11e3-90c8-e3ee27f3aec6}".

There are several "well-known identifiers", and bcdedit will helpfully use these instead where it can, (unless you use the /v (verbose) option with /enum). They look like this: "{bootmgr}", "{memdiag}". These are just shorthand names for full identifiers, but are easier to work with. You can use either.

You can list these sections with the following command (the "all" is optional but without it you won't see a full list): bcdedit /enum all.

Typical output:

C:\Windows\system32>bcdedit /enum all

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume1
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
default                 {current}
resumeobject            {92b1a1b0-c023-11e3-b3f1-ec4d94108574}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Windows 7
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {92b1a1b2-c023-11e3-b3f1-ec4d94108574}
recoveryenabled         Yes
osdevice                partition=C:
systemroot              \Windows
resumeobject            {92b1a1b0-c023-11e3-b3f1-ec4d94108574}
nx                      OptIn

Similarly, for ease when it identifies devices, it will use a format like \Device\HarddiskVolume2, but will recognize the partition by its letter ("C:") if one is assigned.

The list produced by /enum all starts with an optional firmware boot manager section (if your motherboard has EFI). Its shorthand name is "{fwbootmgr}". It controls the initial EFI boot choice (whether to use the usual Windows boot manager, or specific devices). Generally you can ignore {fwbootmgr} if present.

Below that is the "Windows Boot Manager" (identifier "{bootmgr}"). This is one that you will work with. It contains the config for the basic menu or whatever else you get on startup (if Windows Boot Manager is working and it can find BCD in the first place).

Below {bootmgr} are any number of "Windows Boot Loader" sections and possibly other sections, each of which controls one action or boot option.

Setting up dual boot using bcdedit (you don't need anything else)

To dual boot, you tell bcdedit to /copy an existing known good Windows Boot Loader entry for your first OS.

  • /copy to copy an existing entry
  • {current} is the identifier of the entry you want to copy. Its a shortcut for the current boot item. If that's not the one you want to dual boot, use the correct identifier for the one you do want. The description text for each entry will help find the one you want.
  • /d "Description for copied entry will be the new item's description

It will make a copy of that entry, give it the stated description, and respond with the new identifier that it has given the copy:

bcdedit /copy {current} /d "Copy of my current Windows Boot Loader"

The entry was successfully copied to {5599a3fc-e4ee-11e7-a5f3-c86000d0b92a}.

That creates an independent entry with the right name, now you need to tell it what to do. As almost nothing's changed in recent OSes, you can just set the device and osdevice to your Win7 partition, and it'll probably work. If needed, look at the output of /enum when you boot into Win7 normally, and copy the entries it seems to expect. But usually it's enough to assign a letter to your 2nd OS temporarily, like "Q", and then the command is: bcdedit /set {NEW_IDENTIFIER} device partition=Q: or something, and the same for osdevice. bcdedit will sort out the drive letters, see below. You can delete the temp drive letter once it's been used in bcd.

Next add it to the list of entries in {bootmgr} using bcdedit /displayorder {NEW_ID} /addlast, and - crucially - tell bcd to display a boot menu using bcdedit /set {bootmgr} displaybootmenu Yes.

Done.

Note - it's safe to use "odd" or "wrong" drive letters in BCD, and it's safe if /enum's output contains them as well.

To be clear, you don't need to worry about your new device being identified as Q: (or whatever it is) when it "should be C:". bcdedit stores the hard drive ID, not the letter. It's purely accepting and displaying Q: to be helpful. If a device has a letter it'll show the letter by default instead of the device ID, for your ease. You can see this by removing or assigning the letter from the 2nd OS in DISKPART or DISKMGMT.MSCand the output of /enum will immediately revert to a \Device instead. It's actually saved the correct hard drive ID, and when it's used to boot, Windows will find that device - the letter is for ease and never actually saved.

3
  • Where did you get {0743bb44-fda6-11e3-90c8-e3ee27f3aec6} from? You already copied the {current} Windows Boot Loader; what is the other thing you're making a copy of? (Not the Windows Boot Manager i assume)
    – Ian Boyd
    Dec 19, 2017 at 19:40
  • 1
    Thank you. I can confirm this worked like this Windows 10 version 1903 (build 18362). I had an image of Windows 10 OS NTFS partition I restored to a partition on another machine, I rebooted from install media to Windows Recovery and assigned driver letter using diskpart. Then did the bcdedit /copy of the {default} (no {current} in WinRE) and bcdedit /set of device and osdevice to new drive. At reboot I was given the choice of OSes to run and it rebooted the old image just fine. It was Windows 10, which is very flexible booting regardless of complete HW change. Sep 15, 2019 at 6:28
  • In general, MS recommends /copy then change as being easier than (from scratch) /create with all the right params. The stuff I'm a bit in doubt about is whether one needs to change (by /set) resomeobject and/or recoverysequence as well when a partition clone/copy is made. (inherit usually does not need to be changed). Jul 1, 2020 at 3:46
6

Some notes on critic in original question about using same terminology in Visual BCD as Microsoft uses for bcdedit.

The BCD concept is developed by Microsoft. It comes with its own terminology. I don't think I can change it. I can extend it only.

Microsoft has given two ways for accessing/editing BCD:

  1. using bcdedit.exe - command line interface
  2. BCD WMI Provider interface - programmatic interface

Both interfaces talk about BCD objects and elements. This is a general concept used as well in programming/computers as in other human areas. We could go even to philosophy which uses the terminology of objects, properties and relations for describing the world and the universe.

BCD WMI provider access is more flexible as it gives a programmer the possibility to access every object and element in BCD and operate on them freely.

Visual BCD makes full use of BCD WMI Provider Interface and implements access the same way as we are used to access Windows registry using regedit.exe. Moreover the tool automates two main tasks - creation of loaders and dual-boot repair. No other tool offers such one-click automatic functionality. I would say this is new terminology and new level of abstraction. I would not change the base Microsoft has created, I can only build on it.

Novice users just click a button and a complex operation is carried out ! No background is needed ! You even do not have to know how many Windows versions you have installed - the tool tries to find them all and then create loaders for them if corresponding loaders are not already present in BCD - the terminology used - "Create missing Windows loaders" - I think everybody speaking English could understand/click/confirm such an operation or am I wrong ?

The complexity of objects and elements in BCD is natural as the concept covers booting newer and older Windows OS as well as foreign OS like Linux, Unix etc. Moreover it is a general concept for MBR booting and EFI booting on a variety of devices.

The most complex part of BCD is the device concept. You have partition device, ramdisk device, file device, locate device - you have to spend some time understanding it and I don't think this is for the normal Windows user. Forums are full with questions about disk partitions which is a far less complex topic. Many Windows users even don't know about the difference between primary and logical partition for example. You have to know about partitions if you want to dual/multi boot. You have to buy land if you want to build a second house.

The BCD concept is the same since Vista - only new elements are defined in Windows 7/8.

I think the registry structure for BCD is chosen as Windows implements this interface already and it is a reliable transactional interface proven to work over the years. If Windows registry concept in general is a good or a bad concept is another topic.

It is up to the programmer/developer to create a more user friendly interface. I started with giving the same interface - a GUI equivalent of bcdedit - later the interface can be abstracted on a higher level based on usage patterns. A structured view of BCD is already implemented. This is the base abstraction layer.

Next level of abstraction would be to concentrate on relations between objects as this topic is not covered by Microsoft. Not an easy task. New terminology comes with abstraction.

2
  • i understand BCD wraps a very powerful system, with a lot of complex options. On the other hand, i think i have a very simple question, that a lot of people have asked over the years - but never been able to get solved. "i have Windows over here, and another Windows over there. How do i boot between them?". Rather than a full tutorial on all the options of BCDEdit, i was hoping for the commands that can only solve this one (seemingly simple) problem. Perhaps almost something as simple as msconfig, except it lets you browse to another Windows install and it will add it for you.
    – Ian Boyd
    Dec 2, 2012 at 17:14
  • I must say, your tool is much more powerful than EasyBCD.
    – Milind R
    Sep 6, 2014 at 17:32
4

You need a BCDEdit /set command for configure the boot volume. Then add the entry to the Windows Boot Manager operating system menu by calling the BCDEdit /displayorder command.

bcdedit /set {ntldr} device boot

It will identify the other OS' partition or the following command as well

bcdedit /set {ntldr} device partition=C:

The following line makes the entry bootable by adding it to the menu

bcdedit /displayorder {ntldr} /addlast

You can verify that the new entry will appear on the boot menu by running the command bcdedit /enum ACTIVE and looking for the Windows Legacy OS Loader entry.

Note: /create command is used to add non-Microsoft OS to boot loader entry.

For more information regarding this you can read this source article


Regarding your question about "Difference between Windows Boot loader and Boot manager"

From wikipedia

Windows NT startup process starts when the computer finds a Windows boot loader, a portion of Windows operating system responsible for finding Microsoft Windows and starting it up. On IA-32 or x64 systems, the boot loader is called Windows Boot Manager (BOOTMGR). Prior to Windows Vista however, the boot loader was NTLDR.

See also on technet.


Visual BCD Editor is an advanced GUI version of Windows bcdedit utility.

It is the first GUI tool to implement full editing of Windows 7/Vista Boot Configuration Data (BCD) store.

Download page for visual BCD editor.

Give a try to repair option in the tool.

1
  • About Windows Boot Manager: Windows Boot Manager is basically a mini-operating system that controls your boot experience and enables you to choose which boot application to run. There are various boot applications (for example, Windows Boot Loader) and each one does something different. For example, a Windows Boot Loader application loads Windows. [...] For example, if you have two different versions of Win7 installed on different partitions, you will see two Windows Boot Loader entries. (taken from here) Dec 27, 2013 at 13:12
3

In response to the author's specific question as reiterated in the comments (although it does differ from his initial question regarding the bcdedit.exe sequences to accomplish the same):

Perhaps almost something as simple as msconfig, except it lets you browse to another Windows install and it will add it for you.

EasyBCD is exactly what you're looking for (free for personal use). It's a visual dual-boot manager tool for Windows, and adding a new Windows entry is with a point-and-click, exactly as you described it.

There's a lot of resources on EasyBCD online, so I won't repeat everything here. Basically EasyBCD wraps up the complexity of bcdedit.exe and extends it with its own bootloader modules to let you set up dual-boots with other (newer or older) versions of Windows, as well as Linux, BSD, and more.

Full disclosure: I'm the primary author of EasyBCD.

0
-1
bcdedit
bcdboot
bcdedit /create

This can be pointed to a file like .vhd file but created as a partition diskpart and initialized and attached, or mounted on the fly and rebooted as an OS. The OS can be hidden inside another partition. another partition can be hidden inside another partition and OS inside it. when you run bcdedit to be pointed to another .vhd file no matter where it is located. It loads up. My instructor showed this in class but failed or refused to give another explanations to bcdedit. But this works to hide and operate fully functional OS.

  1. bcdboot e:\windows
  2. bcdboot c:\windows

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .