BCDEDIT - How to Use

How to Use the BCDEDIT Command Line Tool

   Information
This will show you how to use BCDEDIT in the command prompt and avoid the need of third party applications like EasyBCD.
   Note
Bcdedit is a really powerful tool that Windows Vista and Windows 7 uses to manage the boot loader entries.

BCDEDIT needs a boot manager to boot your system.



A boot manager is a file that contains necessary information that instruct the system how to boot/start an operating system.
  • Windows 7 and Vista boot manager file is \bootmgr
  • Windows XP boot manager file is \ntldr
BCDEDIT can support other boot managers too, like grub for linux. You just have to place the boot file on the root of the boot manager partition. e.g. \grldr and you have a grub boot loader enabled.

Bcdedit edits a file called bcd , which is located in Windows 7's hidden partition under \boot\bcd.
In Vista, its located under C:\boot\bcd.


   Warning
You must be logged on in an administrator account to be able to do this tutorial.





To Use bcdedit:
1. Open an elevated command prompt.

2. Type bcdedit and press enter.
NOTE: By typing just bcdedit you just list your boot entries.


A boot entry consists of 4 main elements:
1. Identifier
The identifier is how the system has named the boot entry.
2. Device
The device is the drive or virtual image that the system will use to boot the boot entry.
3. Path
The path is the location on the device where the bootloader file is found.
4. Description
The description is the friendly name we give to our boot entry, e.g. "Windows 7"
You see next to the identifiers their UUIDs in {}. The UUID is the unique codename that the system gives to each boot entry and cannot be changed.

The standard identifier UUIDs are explained below:
{bootmgr} = the boot manager
{current} = the OS you selected to boot at startup.
{default} = the default OS selected to boot the PC.
{ntldr} = Windows Legacy OS Loader (for windows xp)
there are others like {memdiag} or {ramdisk} but they can't be of much use right now.
   Warning
IMPORTANT: make a backup of your bcd file first. To do that, type:

bcdedit /export C:\SAVEDBCD

This will create a file c:\savebcd which is your boot entry backup.
If you mess up, you can always undo changes by:

bcdedit /import c:\savedbcd



Now to see how we can control the above entries, here are some examples:
bcdedit /set {current} description "My edited Windows Boot Entry"
NOTE: This changes the title of the boot menu entry "{current}".

bcdedit /set {ntldr} device partition=E:
NOTE: This tells bcd that Windows XP partition is drive E:

bcdedit /set {ntldr} path \ntldr
NOTE: This tells bcd that the ntldr file which is the winxp bootloader is on root folder "\" (of drive e: as stated above)

bcdedit /displayorder {ntldr} /addfirst
NOTE: This places Windows XP as the first OS on the menu list.

bcdedit /default {ntldr}
NOTE: This places Windows XP as the default OS to boot first with.

bcdedit /displayorder {33342343-3424-2342342342-2344} /addlast
NOTE: This tells bcd that the boot entry with UUID 3334... should be the last entry on the menu.
You can copy your existing VISTA or W7 boot entry to another identical. Then you can change settings on the new entry to experiment. You will always have the first entry available, so it's safe to play with.
bcdedit /copy {current} /d "New W7 boot entry I just copied!"
this will give you a line:
NOTE: The entry was successfully copied to {4c21825f-e04b-11dd-b760-00195b61617a}. The {4c21825f-e04b-11dd-b760-00195b61617a} is the UUID of the new entry that the system just created. Yours will be different than mine! This is its identifier and you should use this to address that entry. Example:

bcdedit /set {4c21825f-e04b-11dd-b760-00195b61617a} numpoc 2
NOTE: This adds the 2 CPU Core support during boot, like you do in msconfig.

bcdedit /deletevalue {4c21825f-e04b-11dd-b760-00195b61617a} numproc
NOTE: This deletes the numproc parameter from entry {4c21825f....}

bcdedit /delete {4c21825f-e04b-11dd-b760-00195b61617a}
NOTE: This deletes the boot entry {4c21825f....} completely. In order to delete an {ntldr} entry, you must use the /f switch to force deletion: bcdedit /delete {ntldr} /f

You can always type just bcdedit to see your current settings.

What else can I do with BCDEDIT?

You can use BCDEDIT to alter any boot parameter , like you would in msconfig, only more. BCDEDIT works from booting with installation dvd too, so it can be handy for recovery purposes.
bcdedit /timeout 5
NOTE: This sets the wait-to-select-OS menu timeout at startup to 5 seconds . You will notice that I didn't give a UUID above. If you omit the UUID, it applies automatically to the relavant UUID. So: bcdedit /timeout 5 is identical to bcdedit /set {bootmgr} timeout 5
Some more advanced examples:
bcdedit /set {current} detecthal yes
bcdedit /set {current} detecthal no
NOTE: The above commands sets the detecthal to yes or no for entry {current}
To create a new boot entry to load Windows XP from a partition on your disk:
NOTE: The example below uses F: as the Windows XP partition. Replace with your xp drive letter.
bcdedit /create {ntldr} /d "Windows XP"

bcdedit /set {ntldr} device partition=F:

bcdedit /set {ntldr} path \ntldr

bcdedit /displayorder {ntldr} /addlast
   Note
Final note: BCDEDIT works from installation boot dvd too. If you mess up with a setting and you cannot boot, just boot from DVD and enter Repair Computer, then go to command prompt and there you go. You can play again with bcdedit to restore your system back.



 
Last edited by a moderator:
...

I'm kind of desperate to get back into my XP Installation, I hope someone can explain this issue.


You set up a multi-boot menu when Windows 7 is running and you only need to run 3 commands:

bcdedit /copy {current} /d "XP"

You will get this message with DIFFERENT guid numbers

The entry was successfully copied to {bda1ead3-8577-11de-883c-00226808ae4c}

Use YOUR guid number in the 2 following commands:

bcdedit /set { YOUR GUID NUMBER } osdevice partition=E:

bcdedit /set { YOUR GUID NUMBER } description "XP"


That's it.... you can even run Msconfig and look under the Boot tab and see it.. and modify the priority and time to default to the first entry.


I think Xp will run from a win 7 multi-boot menu.

Hi tblount,

I am afraid that isn't going to work for XP - your instructions add an additional entry under a different description for the NT6 osloader to the partition you are currently booted into.

Windows Boot Loader
-------------------
identifier {160373fe-b6bb-11de-a6fd-001966657855}
device partition=D:
path \windows\system32\winload.exe
description XP
locale en-us
inherit {bootloadersettings}
osdevice partition=E:
systemroot \windows
resumeobject {160373fb-b6bb-11de-a6fd-001966657855}
nx OptIn
detecthal Yes
 

My Computers

System One System Two

  • Computer type
    PC/Desktop
    OS
    7 X64
    CPU
    i5 8400
    Motherboard
    gigabyte b365m ds3h
    Memory
    2x8gb 3200mhz
    Hard Drives
    various
    PSU
    pure power 11 400w cm
    Case
    Coolermaster
    Cooling
    cryorig m9i
  • Computer type
    PC/Desktop
    OS
    7x64
    CPU
    g5400
    Motherboard
    ga b365m ds3h
    Memory
    8gb ddr4 2400
    PSU
    xfx pro 450w
Did you try it?

This works for me to load my backup clone of windows 7 .(which is much easier than reconfiguring my bios twice if I want to boot into my clone hd). .and it also works to run the recovery option so I can easily get a command prompt (outside Windows) without a cd. No os is booted when you see the multi boot menu. You should be able to chose any drive and any os you want. If you don't have anything there... for example you set up a multi-boot entry to boot to a usb and the usb has been taken out you will just go to the recovery menu.

What happened when you tried to run xp from your multi boot menu?
 

My Computer

Computer Manufacturer/Model Number
Gateway
OS
Windows 7
CPU
Core I7
Memory
3 gigs
It hands control to winload.exe - the osloader for NT6 operating systems - which is why it will load up a clone of 7.

Ntldr is the osloader for XP. I don't think winload.exe can also load XP.

I don't have XP installed.

To add an entry for ntldr to nt6 bcd so that control is handed to ntldr on selection from the bootmenu :

Bcdedit /create {ntldr} /d "Description for earlier Windows version"

Bcdedit /set {ntldr} device partition=x:

( replace x: with the drive letter for the active partition.)

Bcdedit /set {ntldr} path \ntldr

Bcdedit /displayorder {ntldr} /addlast
 

My Computers

System One System Two

  • Computer type
    PC/Desktop
    OS
    7 X64
    CPU
    i5 8400
    Motherboard
    gigabyte b365m ds3h
    Memory
    2x8gb 3200mhz
    Hard Drives
    various
    PSU
    pure power 11 400w cm
    Case
    Coolermaster
    Cooling
    cryorig m9i
  • Computer type
    PC/Desktop
    OS
    7x64
    CPU
    g5400
    Motherboard
    ga b365m ds3h
    Memory
    8gb ddr4 2400
    PSU
    xfx pro 450w
Hey Limneos, thanks for the post.... I'm not really an IT pro here but was very fascinated by the new features of visualization. Tried to Google and play with the VHD and Bcdedit but most of the time my setting were all messed up..... All I can say here is, this is the best, the most detailed post I had ever come across this past few weeks.... Good job and keep it up! ( Google no further, this will be my one and only search place for Windows 7)

Cheers!
 

My Computer

OS
Windows 7
Boot problems

Hi guys..

I had an installation of Windows 7 RC on C:
and an installation of Windows 7 Retail on D:

Since the installation on C: was no longer needed i formatted C: ..
and removed the Windows 7 RC entry with EasyBCD 1.7.

Now when i boot i get a black screen with a blinking cursor.
And Windows 7 dvd can't fix the problem.

How do i get i to boot from D: ..?
I know i have to use Bcdedit from command promt, but not sure what to type..?

Please help me..

Chris
 

My Computer

OS
Windows 7
Hi guys..

I had an installation of Windows 7 RC on C:
and an installation of Windows 7 Retail on D:

Since the installation on C: was no longer needed i formatted C: ..
and removed the Windows 7 RC entry with EasyBCD 1.7.

Now when i boot i get a black screen with a blinking cursor.
And Windows 7 dvd can't fix the problem.

How do i get i to boot from D: ..?
I know i have to use Bcdedit from command promt, but not sure what to type..?

Please help me..

Chris


Boot with the DVD and start Command Prompt.

Using the guide above , you will find how to change the boot drive and the bootmanager drive.

e.g.:

Code:
bcdedit /set {-your-windows-uuid-identifier} device partition=D:  // (your new drive)
 
bcdedit /set {-your-windows-uuid-identifier} osdevice partition=D:

It might not work even after this though without re-running a startup repair from the DVD, so it can create the bootloader files appropriately cause you probably deleted them along with the old partition.

in general, it should look like this:

Code:
Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Windows 7
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {34565ac3-8f05-11de-8a93-f70097160656}
recoveryenabled         Yes
osdevice                partition=C:
systemroot              \Windows
resumeobject            {344654ac1-8f05-11de-8a93-f70097160656}
nx                      OptIn
numproc                 2
usefirmwarepcisettings  No
 

My Computer

Computer Manufacturer/Model Number
ENIAC
OS
Windows 7 RC 7100 32bit/64bit
CPU
Intel Core2Duo E4500 2.20 GHz
Motherboard
ASUS P5LD2-X/1333
Memory
2x1GB Kinsgston DDR2 800MHz
Graphics Card(s)
Nvidia 8500GT
Sound Card
Onboard High Definition Audio Device
Monitor(s) Displays
Sony Bravia 42"
Case
LINKW 2222
Cooling
Standard Intel
Keyboard
Some cheap one
Mouse
Microsoft Intellimouse something
Internet Speed
24MBps ADSL
Hey Limneos, thanks for the post.... I'm not really an IT pro here but was very fascinated by the new features of visualization. Tried to Google and play with the VHD and Bcdedit but most of the time my setting were all messed up..... All I can say here is, this is the best, the most detailed post I had ever come across this past few weeks.... Good job and keep it up! ( Google no further, this will be my one and only search place for Windows 7)

Cheers!


Glad you find it useful! ;-)
 

My Computer

Computer Manufacturer/Model Number
ENIAC
OS
Windows 7 RC 7100 32bit/64bit
CPU
Intel Core2Duo E4500 2.20 GHz
Motherboard
ASUS P5LD2-X/1333
Memory
2x1GB Kinsgston DDR2 800MHz
Graphics Card(s)
Nvidia 8500GT
Sound Card
Onboard High Definition Audio Device
Monitor(s) Displays
Sony Bravia 42"
Case
LINKW 2222
Cooling
Standard Intel
Keyboard
Some cheap one
Mouse
Microsoft Intellimouse something
Internet Speed
24MBps ADSL
Thx Limneos..

But im not sure where i can locate the UUID number..?

When i type D:\Users\myname>bcdedit it says:

The boot configuration data store could not be opened.
The requested system device cannot be found..

Any ideas..?

Chris
 

My Computer

OS
Windows 7
Hi Chris,

Boot 7 dvd to cmd prompt,

Type:

Diskpart

lis vol

( find the letter for your Win 7 retail volume - use that in place of ? below )

sel vol ?:

act

exi

Then run startup repair 3 times.
 

My Computers

System One System Two

  • Computer type
    PC/Desktop
    OS
    7 X64
    CPU
    i5 8400
    Motherboard
    gigabyte b365m ds3h
    Memory
    2x8gb 3200mhz
    Hard Drives
    various
    PSU
    pure power 11 400w cm
    Case
    Coolermaster
    Cooling
    cryorig m9i
  • Computer type
    PC/Desktop
    OS
    7x64
    CPU
    g5400
    Motherboard
    ga b365m ds3h
    Memory
    8gb ddr4 2400
    PSU
    xfx pro 450w
Thx SIW2..

Progress i think :)

Now, when i boot it says:

BOOTMGR is missing
Press Ctrl+Alt+Del to restart

What should i do..?

Chris
 

My Computer

OS
Windows 7

My Computers

System One System Two

  • Computer type
    PC/Desktop
    OS
    7 X64
    CPU
    i5 8400
    Motherboard
    gigabyte b365m ds3h
    Memory
    2x8gb 3200mhz
    Hard Drives
    various
    PSU
    pure power 11 400w cm
    Case
    Coolermaster
    Cooling
    cryorig m9i
  • Computer type
    PC/Desktop
    OS
    7x64
    CPU
    g5400
    Motherboard
    ga b365m ds3h
    Memory
    8gb ddr4 2400
    PSU
    xfx pro 450w
Yes i did run startup repair 3 times..

I have Partition wizard open now..

what is it exactly you want to know..?

Chris
 

My Computer

OS
Windows 7
The partition where Windows is located is active.. all other is inactive..

Chris
 

My Computer

OS
Windows 7
What does it say about each partition - the full details please.
 

My Computers

System One System Two

  • Computer type
    PC/Desktop
    OS
    7 X64
    CPU
    i5 8400
    Motherboard
    gigabyte b365m ds3h
    Memory
    2x8gb 3200mhz
    Hard Drives
    various
    PSU
    pure power 11 400w cm
    Case
    Coolermaster
    Cooling
    cryorig m9i
  • Computer type
    PC/Desktop
    OS
    7x64
    CPU
    g5400
    Motherboard
    ga b365m ds3h
    Memory
    8gb ddr4 2400
    PSU
    xfx pro 450w
Curious, you have a Primary Active partition - Windows is installed on it - and several runs of startup repair gives bootmgr is missing?

From 7 dvd cmd , type:

bootsect /nt60 all /mbr
 

My Computers

System One System Two

  • Computer type
    PC/Desktop
    OS
    7 X64
    CPU
    i5 8400
    Motherboard
    gigabyte b365m ds3h
    Memory
    2x8gb 3200mhz
    Hard Drives
    various
    PSU
    pure power 11 400w cm
    Case
    Coolermaster
    Cooling
    cryorig m9i
  • Computer type
    PC/Desktop
    OS
    7x64
    CPU
    g5400
    Motherboard
    ga b365m ds3h
    Memory
    8gb ddr4 2400
    PSU
    xfx pro 450w
Ok.. Not sure exactly sure what you mean by full details, but here goes : )

Disk 1:
*:
File system: NTFS
Capacity: 37.27GB
Used: 86.96MB
Unused: 37.16GB
Status: none
Type: Primary

Disk 2:
*:Windows 7
File system: NTFS
Capacity: 131.83GB
Used: 114.69GB
Unused: 17.14GB
Status: Active
Type: Primary

*:Samsung
File system: NTFS
Capacity: 131.83GB
Used: 101.05GB
Unused: 82.40GB
Status: none
Type: Primary

Disk 3
*:Q
File system: FAT32
Capacity: 19.01GB
Used: 13.42GB
Unused: 5.59GB
Status: Active
Type: Primary

Disk 4
*:
File system: Unallocated
Capacity: 7.88MB
Used: 0B
Unused: 7.88MB
Status: none
Type: Logical

*:Entertainment
File system: NTFS
Capacity: 97.66GB
Used: 96.60GB
Unused: 1.06GB
Status: none
Type: Logical

*:Downloads
File system: NTFS
Capacity: 97.66GB
Used: 97.21GB
Unused: 457.61MB
Status: none
Type: Logical

*:Downloads2
File system: NTFS
Capacity: 48.83GB
Used: 48.43GB
Unused: 417.11MB
Status: none
Type: Logical

*:Pics and Progz
File system: NTFS
Capacity: 53.92GB
Used: 53.07GB
Unused: 867.88MB
Status: none
Type: Logical

Chris
 

My Computer

OS
Windows 7
Was RC on Disk 1?

In Pw rt click Q select Modify>Set as Inactive.

Then see what startup repair does.
 

My Computers

System One System Two

  • Computer type
    PC/Desktop
    OS
    7 X64
    CPU
    i5 8400
    Motherboard
    gigabyte b365m ds3h
    Memory
    2x8gb 3200mhz
    Hard Drives
    various
    PSU
    pure power 11 400w cm
    Case
    Coolermaster
    Cooling
    cryorig m9i
  • Computer type
    PC/Desktop
    OS
    7x64
    CPU
    g5400
    Motherboard
    ga b365m ds3h
    Memory
    8gb ddr4 2400
    PSU
    xfx pro 450w
Yes RC was on Disk 1..

I did as you said i both posts, But it still says BOOTMGR is missing..

??

Chris
 

My Computer

OS
Windows 7
Use the letter for 7 retail partition ( as seen by Diskpart in place of ?: It might be different from the letter you see in Windows and PW - press enter after each command)

bcdboot ?:\windows /s ?:

bootsect /nt60 ?:
 

My Computers

System One System Two

  • Computer type
    PC/Desktop
    OS
    7 X64
    CPU
    i5 8400
    Motherboard
    gigabyte b365m ds3h
    Memory
    2x8gb 3200mhz
    Hard Drives
    various
    PSU
    pure power 11 400w cm
    Case
    Coolermaster
    Cooling
    cryorig m9i
  • Computer type
    PC/Desktop
    OS
    7x64
    CPU
    g5400
    Motherboard
    ga b365m ds3h
    Memory
    8gb ddr4 2400
    PSU
    xfx pro 450w
Back
Top