Microsoft DOS bcdedit command

Updated: 04/26/2017 by Computer Hope

About bcdedit

The bcdedit command-line tool modifies the boot configuration data store. The boot configuration data store contains boot configuration parameters and controls how the operating system is booted. These parameters were previously in the boot.ini file (in BIOS-based operating systems) or in the nonvolatile RAM entries (in Extensible Firmware Interface-based (EFI) operating systems). You can use Bcdedit.exe to add, delete, edit, and append entries in the boot configuration data store.

Availability

The bcdedit command is an external command that is available in the below Microsoft operating systems as bcdedit.exe.

Windows Vista
Windows 7
Windows 8
Windows 10

Bcdedit syntax

Tip: To use the bcdedit command you must be in an elevated command prompt.

Note: Running "bcdedit" by itself is equivalent to running "bcdedit /enum ACTIVE".

Commands that operate on a store

/createstore

This command created a new empty boot configuration data store. The created store is not a system store.

bcdedit /createstore <file name>

<file name> specifies the file name of the boot configuration data store. If the file name contains spaces, it must be enclosed in quotation marks ("").

Example:

The following command creates the specified store file:

bcdedit /createstore C:\DATA\BCD

/export

This command exports the contents of the system store into a file. This file can be used later to restore the state of the system store. This command is only valid for the system store.

<file name> The file name to be used as the destination for the export. If the file name contains spaces, it must be enclosed in quotation marks ("").

Example:

The following command exports the system store to the specified file:

bcdedit /export "C:\Data\BCD Backup"

/import

This command restores the state of the system store using a backup data file previously generated using the /export command. Any existing entries in the system store are deleted before the import takes place. This command is only valid for the system store.

bcdedit /import <file name> [/clean]

<file name> the name of the file that is imported into the system store.

If the file name contains spaces, it must be enclosed in quotation marks ("").

/clean specifies that all existing firmware boot entries should be deleted (only affects EFI systems).

Example:

The following command imports the specified file into the system store.

bcdedit /import "C:\Data\BCD Backup" /clean

/sysstore

This command sets the system store device. This command is only valid for EFI systems in cases where the system store device is ambiguous. This setting does not persist across reboots.

bcdedit /sysstore <devicename>

<devicename> the name of a system partition to set as the system store device. The device must be a system partition.

Example:

The following command sets the system store device as specified:

bcdedit /sysstore C:

Commands that operate on entries in a store

/copy

This command creates a copy of the specified boot entry.

bcdedit [/store <file name>] /copy {<id>} /d <description>

<file name> specifies the store to be used. If this option is not specified, the system store is used. For more information, run "bcdedit /? store".

<id> specifies the identifier of the entry to be copied. For more information about identifiers, run"bcdedit /? ID".

<description> specifies the description to be applied to the new entry.

Example:

The following command creates a copy of the specified operating system boot entry:

bcdedit /copy {cbd971bf-b7b8-4885-951a-fa03044f5d71} /d "Copy of entry"

/create

The following command creates a NTLDR based OS loader entry (Ntldr):

bcdedit /create {ntldr} /d "Earlier Windows OS Loader"

The following command creates a RAM disk additional options entry:

bcdedit /create {ramdiskoptions}

The following command creates a new operating system boot entry:

bcdedit /create /d "Windows Vista" /application osloader

The following command creates a new debugger settings entry:

bcdedit /create {dbgsettings}

/delete

This command deletes an entry from the boot configuration data store.

bcdedit [/store <file name>] /delete <id> [/f] [/cleanup | /nocleanup]

<file name> specifies the store to be used. If this option is not specified, the system store is used. For more information, run "bcdedit /? store".

<id> specifies the identifier of the boot entry that you want to delete. For more information about identifiers, run "bcdedit /? ID".

/f Deletes the specified entry. Without this option, bcdedit will not delete any entries that have a well-known identifier.

/cleanup Deletes the specified entry and removes the entry from the display order. Any other references to the entry being deleted are removed from the store. When deleting an OS loader entry, the associated resume from hibernation entry is also deleted if it is not referenced by any other OS loaders. This option is assumed unless /nocleanup is specified.

/nocleanup Deletes the specified entry without removing the entry from the display order.

Examples:

The following command deletes the specified operating system entry from the store and removes the entry from the display order:

bcdedit /delete {cbd971bf-b7b8-4885-951a-fa03044f5d71}

The following command deletes the specified operating system entry from the store and removes the entry from the display order:

bcdedit /delete {cbd971bf-b7b8-4885-951a-fa03044f5d71} /cleanup

The following command deletes the specified operating system entry from the store without removing the entry from the display order:

bcdedit /delete {cbd971bf-b7b8-4885-951a-fa03044f5d71} /nocleanup

The following command deletes the NTLDR based OS loader entry from the store:

bcdedit /delete {ntldr} /f

/mirror

This command creates a mirror of the specified boot entry.

bcdedit [/store <file name>] /mirror {<id>}

<file name> specifies the store to be used. If this option is not specified, the system store is used. For more information, run "bcdedit /? store".

<id> specifies the identifier of the entry to be mirrored. For more information about identifiers, run "bcdedit /? ID".

Example:

The following command creates a mirror of the specified operating system boot entry:

bcdedit /mirror {cbd971bf-b7b8-4885-951a-fa03044f5d71}

Commands that operate on entry options

/deletevalue

This command deletes a data element from an entry in the boot configuration data store.

bcdedit [/store <file name>] /deletevalue [<id>] <datatype>

<file name> specifies the store to be used. If this option is not specified, the system store is used. For more information, run "bcdedit /? store".

<id> specifies the identifier of the entry that will be modified. If not specified, {current} is used. For more information about identifiers, run "bcdedit /? ID".

<datatype> specifies the option that will be removed from the specified entry. Run "bcdedit /? TYPES" for more information about data types.

Examples:

The following command deletes the bootsequence option from the boot manager entry:

bcdedit /deletevalue {bootmgr} bootsequence

The following command deletes the Windows Pre-installation Environment (WinPE) value from the current operating system boot entry:

bcdedit /deletevalue winpe

The following command deletes the Windows PE value from the specified operating system boot entry:

bcdedit /deletevalue {cbd971bf-b7b8-4885-951a-fa03044f5d71} winpe

/set

This command sets an entry option value in the boot configuration data store.

bcdedit [/store <file name>] /set [{<id>}] <datatype> <value> [ /addfirst | /addl ast | /remove ]

<file name> specifies the store to be used. If this option is not specified, the system store is used. For more information, run "bcdedit /? store".

<id> specifies the identifier of the entry to be modified. If not specified, {current} is used. For more information about identifiers, run "bcdedit /? ID".

<datatype> specifies the option data type that will be created or modified. Run "bcdedit /? TYPES" for more information about data types.

<value> specifies the value that should be assigned to the option. The format of <value> depends on the data type specified. Run "bcdedit /? FORMATS" for more information about data formats.

/addfirst this switch can only be used if datatype is an object list. Adds the specified entry identifier to the top of the list. If this switch is specified, only a single entry identifier may be specified. If the specified identifier is already in the list, it will be moved to the top of the list.

/addlast this switch can only be used if datatype is an object list. Adds the specified entry identifier to the end of the list. If this switch is specified, only a single entry identifier may be specified. If the specified identifier is already in the list, it is moved to the end of the list.

/remove This switch can only be used if datatype is an object list. Removes the specified entry identifier from the list. If this switch is specified, only a single entry identifier may be specified. If the identifier is not in the list then the operation has no effect. If the last entry is being removed, then the datatype value is deleted.

Examples:

The following command sets the application device to the partition C: for the specified operating system entry:

bcdedit /set {cbd971bf-b7b8-4885-951a-fa03044f5d71} device partition=C:

NOTE: Use 'hd_partiton=' syntax to explicitly disable automatic VHD detection, and create entries that are compatible for booting a virtual machine, for example:

bcdedit /store F:\boot\bcd /set {default} device hd_partition=F:

The following command sets the OS device to a VHD file (C:\vdisks\vdisk01.vhd) for the specified operating system entry:

bcdedit /set {cbd971bf-b7b8-4885-951a-fa03044f5d71} osdevice vhd=[C:]\vdisks\disk01.vhd

The following command sets the application path to \windows\system32\winload.exe for the specified operating system entry:

bcdedit /set {cbd971bf-b7b8-4885-951a-fa03044f5d71} path \windows\system32\winload.exe

The following command sets the NX policy to OptIn for the current operating system boot entry.

bcdedit /set nx optin

Commands that control output

/enum

This command lists entries in a store. The /enum command is the default, so running "bcdedit" without parameters is equivalent to running "bcdedit /enum ACTIVE".

bcdedit [/store <file name>] /enum [<type> | <id>] [/v]

<file name> specifies the store to be used. If this option is not specified, the system store is used. For more information, run "bcdedit /? store".

<type> specifies the type of entries to be listed. <type> can be one of the following:

ACTIVE All entries in the boot manager display order by default.

FIRMWARE All firmware applications.

BOOTAPP All boot environment applications.

BOOTMGR The boot manager.

OSLOADER All operating system entries.

RESUME All resume from hibernation entries.

INHERIT All inherit entries.

ALL Do All entries.

<id> specifies the identifier of the entry to be listed. If an identifier is provided, then only the specified object will be listed. For information about identifiers, run "bcdedit /? ID".

/v Displays entry identifiers in full, rather than using names for well-known identifiers.

Examples:

The following command lists all operating system loader boot entries:

bcdedit /enum OSLOADER

The following command lists all boot manager entries:

bcdedit /enum BOOTMGR

The following command lists only the default boot entry:

bcdedit /enum {default}

The following command lists only the specified operating system boot entry:

bcdedit /enum {b38a9fc1-5690-11da-b795-e9ad3c5e0e3a}

/v

Command-line option that displays entry identifiers in full, rather than using names for well-known identifiers.

Use /v by itself as a command to display entry identifiers in full for the ACTIVE type.

Usually, any well-known entry identifiers are replaced by their friendly shorthand form. Specifying /v as a command-line switch prevents this replacement and displays all identifiers in full. Running "bcdedit /v" by itself is equivalent to running "bcdedit /enum ACTIVE /v".

bcdedit /v

Example:

The following command lists the active entries in the system store with all entry identifiers displayed in full.

bcdedit /enum ACTIVE /v

Commands that control the boot manager

/bootsequence

This command sets the one-time boot sequence to be used by the boot manager.

bcdedit /bootsequence <id> [...] [ /addfirst | /addlast | /remove ]

<id> [...] specifies a list of identifiers that make up the boot sequence. You must specify at least one identifier and must separate identifiers by spaces. For more information about identifiers, run "bcdedit /? ID".

/addfirst Adds the specified entry identifier to the top of the boot sequence. If this switch is specified, only a single identifier may be specified. If the identifier is already in the list, it is moved to the top of the list.

/addlast Adds the specified entry identifier to the end of the boot sequence. If this switch is specified, only a single identifier may be specified. If the identifier is already in the list, it is moved to the end of the list.

/remove Removes the specified entry identifier from the boot sequence. If this switch is specified, only a single entry identifier may be specified. If the identifier is not in the list then the operation has no effect. If the last entry is being removed, then the boot sequence value is deleted from the boot manager entry.

Examples:

The following command sets two OS entries and the NTLDR based OS loader in the boot manager one-time boot sequence:

bcdedit /bootsequence {802d5e32-0784-11da-bd33-000476eba25f} {cbd971bf-b7b8-4885-951a-fa03044f5d71} {ntldr}

The following command adds the specified OS entry to the end of the boot manager one-time boot sequence:

bcdedit /bootsequence {802d5e32-0784-11da-bd33-000476eba25f} /addlast

/default

This command sets the default entry that the boot manager will use when the timeout expires.

bcdedit /default <id>

<id> specifies the identifier of the boot entry to be used as the default when the time-out expires. For information about identifiers, run "bcdedit /? ID".

Examples:

The following command sets the specified entry as the default boot manager entry:

bcdedit /default {cbd971bf-b7b8-4885-951a-fa03044f5d71}

The following command sets the NTLDR based OS loader as the default entry:

bcdedit /default {ntldr}

/displayorder

This command sets the display order to be used by the boot manager.

bcdedit /displayorder <id> [...] [ /addfirst | /addlast | /remove ]

<id> [...] specifies a list of identifiers that make up the display order. At least one identifier must be specified and they must be separated by spaces. For more information about identifiers, run "bcdedit /? ID".

/addfirst Adds the specified entry identifier to the top of the display order. If this switch is specified, only a single entry identifier may be specified. If the specified identifier is already in the list, it will be moved to the top of the list.

/addlast Adds the specified entry identifier to the end of the display order. If this switch is specified, only a single entry identifier may be specified. If the specified identifier is already in the list, it is moved to the end of the list.

/remove Removes the specified entry identifier from the display order. If this switch is specified, only a single entry identifier may be specified. If the identifier is not in the list then the operation has no effect. If the last entry is being removed, then the display order value is deleted from the boot manager entry.

Examples:

The following command sets two OS entries and the NTLDR based OS loader in the boot manager display order:

bcdedit /displayorder {802d5e32-0784-11da-bd33-000476eba25f} {cbd971bf-b7b8-4885-951a-fa03044f5d71} {ntldr}

The following command adds the specified OS entry to the end of the boot manager display order:

bcdedit /displayorder {802d5e32-0784-11da-bd33-000476eba25f} /addlast

/timeout

This command sets the time to wait, in seconds, before the boot manager selects a default entry. For information about setting the default entry, run "bcdedit /? default".

bcdedit /timeout <timeout>

<timeout> specifies the time to wait, in seconds, before the boot manager selects a default entry.

Example:

The following command sets the boot manager <timeout> to 30 seconds:

bcdedit /timeout 30

/toolsdisplayorder

This command will set the display order to be used by the boot manager when displaying the tools menu.

bcdedit /toolsdisplayorder <id> [...] [ /addfirst | /addlast | /remove ]

<id> [...] specifies a list of identifiers that make up the tools display order. At least one identifier must be specified and they must be separated by spaces. For more information about identifiers, run "bcdedit /? ID".

/addfirst adds the specified entry identifier to the top of the tools display order. If this switch is specified, only a single entry identifier may be specified. If the specified identifier is already in the list, it is moved to the top of the list.

/addlast adds the specified entry identifier to the end of the tools display order. If this switch is specified, only a single entry identifier may be specified. If the specified identifier is already in the list, it is moved to the end of the list.

/remove removes the specified entry identifier from the tools display order. If this switch is specified, only a single entry identifier may be specified. If the identifier is not in the list, then the operation has no effect. If the last entry is being removed, then the tools display order value is deleted from the boot manager entry.

Examples:

The following command sets two tools entries and the memory diagnostic in the boot manager's tools display order:

bcdedit /toolsdisplayorder {802d5e32-0784-11da-bd33-000476eba25f} {cbd971bf-b7b8-4885-951a-fa03044f5d71} {memdiag}

The following command adds the specified tool entry to the end of the boot manager's tools display order:

bcdedit /toolsdisplayorder {802d5e32-0784-11da-bd33-000476eba25f} /addlast

Commands that control Emergency Management Services for a boot application

/bootems

This command enables or disables Emergency Management Services for the specified entry.

bcdedit /bootems [<id>] { ON | OFF }

<id> specifies the identifier of the entry to be modified. Although this command will work for any entry, it is only effective for boot applications.

Example:

The following command enables Emergency Management Services for the boot manager:

bcdedit /bootems {bootmgr} ON

/ems

This command enables or disables Emergency Management Services for the specified operating system boot entry.

bcdedit /ems [<id>] { ON | OFF }

<id> specifies the identifier of the entry to be modified. Only "Windows boot loader" entries can be specified. If not specified, {current} is used. For more information about identifiers, run "bcdedit /? ID".

Example:

The following command enables Emergency Management Services for the current operating system boot entry:

bcdedit /ems ON

/emssettings

This command sets the global Emergency Management Services settings for the system. Emssettings does not enable or disable Emergency Management Services for any particular boot entry.

bcdedit /emssettings [ BIOS ] | [ EMSPORT:<port> | [EMSBAUDRATE:<baudrate>] ]

BIOS specifies that the system will use BIOS settings for the Emergency Management Services configuration. This switch only works on systems that have Emergency Management Services support provided by the BIOS.

<port> specifies the serial port to use as the Emergency Management Services port. This should not be specified with the BIOS option.

<baudrate> specifies the serial baud rate to use for Emergency Management Services. This command should not be specified with the BIOS option. <baudrate> is optional, and the default is 9,600 baud.

Examples:

The following command sets the Emergency Management Services parameters to use BIOS settings:

bcdedit /emssettings BIOS

The following command sets the Emergency Management Services parameters to use com2: at 115,200 baud.

bcdedit /emssettings EMSPORT:2 EMSBAUDRATE:115200

Command that control debugging

/bootdebug

This command enables or disables the boot debugger for the specified boot entry. Although this command works for any entry, it is only effective for boot applications.

bcdedit /bootdebug [<id>] { ON | OFF }

<id> specifies the identifier of the entry to be modified. For information about identifiers, run "bcdedit /? ID".

Examples:

The following command enables boot debugging for the Windows operating system loader of the current operating system boot entry:

bcdedit /bootdebug ON

The following command disables boot debugging for the Windows boot manager:

bcdedit /bootdebug {bootmgr} OFF

/dbgsettings

Sets the global debugger parameters.

/debug

This command enables or disables the kernel debugger for the specified boot entry.

bcdedit /debug [<id>] { ON | OFF }

<id> specifies the identifier of the entry to be modified. Only Windows boot loader entries may be specified. If not specified, {current} is used. For more information about identifiers, run "bcdedit /? ID".

Examples:

The following command enables kernel debugging for the current Windows operating system boot entry:

bcdedit /debug ON

The following command disables kernel debugging for the specified operating system entry:

bcdedit /debug {cbd971bf-b7b8-4885-951a-fa03044f5d71} OFF

/hypervisorsettings

This command sets or displays the hypervisor settings for the system.

This command does not enable or disable the hypervisor debugger for any particular OS loader entry. To enable or disable the hypervisor debugger for a particular OS loader entry, use "bcdedit /set <identifier> HYPERVISORDEBUG ON". For information about identifiers, run "bcdedit /? ID".

To set an individual hypervisor debugger setting, use "bcdedit /set {hypervisorsettings} <type> <value>". For information about valid types, run "bcdedit /? TYPES".

bcdedit /hypervisorsettings [ <debugtype> [DEBUGPORT:<port>] [BAUDRATE:<baud>] [CHANNEL:<channel>] [HOSTIP:<ip>] [PORT:<port>] ]

<debugtype> specifies the type of debugger. <debugtype> can be one of SERIAL, 1394, or NET.

<port> for SERIAL debugging, specifies the serial port to use as the debugging port.

<baud> for SERIAL debugging, specifies the baud rate to be used for debugging.

<channel> for 1394 debugging, specifies the 1394 channel to be used for debugging.

<ip> for network debugging, specifies the IPv4 address of the host debugger.

<port> for network debugging, specifies the port to communicate with on the host debugger. Should be 49152 or higher.

Examples:

The following command displays the current hypervisor settings:

bcdedit /hypervisorsettings

The following command sets the hypervisor debugger settings to serial debugging over COM1 at 115,200 baud:

bcdedit /hypervisorsettings SERIAL DEBUGPORT:1 BAUDRATE:115200

The following command sets the hypervisor debugger settings to 1394 debugging using channel 23:

bcdedit /hypervisorsettings 1394 CHANNEL:23

The following command sets the hypervisor debugger settings to network debugging with a debugger host at 192.168.1.2 communicating on port 50000:

bcdedit /hypervisorsettings NET HOSTIP:192.168.1.2 PORT:50000

Bcdedit examples

See each of the above bcdedit command switch syntax and examples.