- BCDEdit /debug
- Parameters
- Comments
- BCDEdit /dbgsettings
- Parameters
- Examples
- LOCAL
- Example
- SERIAL
- Example
- Example
- General Debugger Settings
- Comments
- See also
- BCDEdit /bootdebug
- Parameters
- Comments
- BCDEdit Command-Line Options
- BCDEdit Command-Line Options
- Operating on a store
- Operating on entries in a store
- Changing entry options
- Controlling output
- Controlling the boot manager
- Emergency Management Services options
- Debugging
BCDEdit /debug
The /debug boot option enables or disables kernel debugging of the Windows operating system associated with the specified boot entry or the current boot entry.
Before setting BCDEdit options you might need to disable or suspend BitLocker and Secure Boot on the computer.
Parameters
The <ID> is the ID that is associated with the boot entry, such as
on
Enables kernel debugging of the specified boot entry. If a boot entry is not specified, kernel debugging is enabled for the current operating system.
off
Disables kernel debugger of the specified boot entry. If a boot entry is not specified, kernel debugging is disabled for the current operating system.
Comments
The /debug boot option enables kernel debugging for a specific boot entry. Use the /dbgsettings option to configure the type of debugging connection to use and the connection parameters. If no /dbgsettings are specified for the boot entry, the global debug settings are used. The default values for the global settings are shown in the following table.
dbgsetting parameter | Default value |
---|---|
debugtype | Local |
debugstart | Active |
noumex | Yes |
The following example enables kernel debugging of the default boot entry.
BCDEdit /dbgsettings
The /dbgsettings option sets or displays the current global debugger settings for the computer. To enable or disable the kernel debugger, use the BCDEdit /debug option.
Before setting BCDEdit options you might need to disable or suspend BitLocker and Secure Boot on the computer.
Parameters
Specifies that the target machine and the host machine will use an Ethernet network connection for debugging. When this option is used, the HOSTIP and PORT parameters must be included as well. The target computer must have a network adapter that is supported by Debugging Tools for Windows.
HOSTIP:ip
For network debugging, specifies the IP address of the host debugger.
KEY:key
For network debugging, specifies the key with which to encrypt the connection. 8 and [a-z] allowed only. Do not specify this parameter if you have specified the newkey parameter.
PORT:port
For network debugging, specifies the port to communicate with on the host debugger. Should be 49152 or higher.
newkey
For network debugging specifies that a new encryption key should be generated for the connection. Do not specify this parameter if you have specified a KEY parameter.
nodhcp
Setting nodhcp prevents use of DHCP to obtain the target IP address. This option is rarely required as even small routers provide support for DHCP. The nodhcp option should only be used if you know that there are no DHCP servers on the network. In most situations, the KDNET transport works best when this option is not set, and DHCP is enabled.
busparams=Bus.Device.Function Specifies the target controller. Bus specifies the bus number, Device specifies the device number, and Function specifies the function number.
To specify the bus parameters, Open Device Manager, and locate the network adapter that you want to use for debugging. Open the property page for the network adapter, and make a note of the bus number, device number, and function number. These values are displayed in Device Manager under Location on the General tab. In an elevated Command Prompt Window, enter the following command, where b, d, and f are the bus, device and function numbers in decimal format:
If you are manually configuring a debugger connection, you must specify the bus parameters. For more information, see Setting Up KDNET Network Kernel Debugging Manually and Setting Up Kernel-Mode Debugging over a USB 3.0 Cable Manually.
Examples
The following command configures the target computer to use an Ethernet connection for debugging and specifies the IP address of the host computer. The command also specifies a port number that the host computer can use to connect to the target computer.
The following command sets the global debugger settings to network debugging using IPv6 with a debugger host at 2001:48:d8:2f:5e:c0:42:28:4f5b communicating on port 50000:
Setting up a network debugging manually is a complex and error prone process. To set up network debugging automatically, see Setting Up KDNET Network Kernel Debugging Automatically. Using the KDNET utility is strongly recommended for all debugger users.
LOCAL
The LOCAL option sets the global debugging option to local debugging. This is kernel-mode debugging on a single computer. In other words, the debugger runs on the same computer that is being debugged. With local debugging you can examine state, but not break into kernel mode processes that would cause the OS to stop running.
Example
The following command sets the global debugger settings to local debugging.
The LOCAL option is available in Windows 8.0 and Windows Server 2012 and later.
For information on setting up local kernel mode debugging manually, see Setting Up Local Kernel Debugging of a Single Computer Manually.
SERIAL
Specifies that the target machine and the host machine will use a serial connection for debugging. When this option is used, the DEBUGPORT and BAUDRATE parameters should be specified.
BAUDRATE:baud
Specifies the baud rate to use. This parameter is optional. Valid values for baud are 9600, 19200, 38400, 57600, and 115200. The default baud rate is 115200 bps.
DEBUGPORT:port
Specifies the serial port to use as the debugging port. This is an optional setting. The default port is 1 (COM 1).
Example
The following command configures the target computer to use a serial connection for debugging. The command also specifies that the debugging connection will use COM1 and a baud rate of 115,200.
Specifies that the target machine and the host machine will use a USB 2.0 or USB 3.0 connection for debugging. When this option is used, the TARGETNAME parameter must be included as well.
TARGETNAME: targetname
Specifies a string value to use for the target name. Note that TargetName does not have to be the official name of the target computer; it can be any string that you create as long as it meets these restrictions:
- The string must not contain “debug” anywhere in the TargetName in any combination of upper or lower case. For example if you use “DeBuG” or «DEBUG» anywhere in your targetname, debugging will not work correctly.
- The only characters in the string are the hyphen (-), the underscore(_), the digits 0 through 9, and the letters A through Z (upper or lower case).
- The maximum length of the string is 24 characters.
Example
The following command configures the target computer to use USB connection for debugging. The command also specifies a target name that the host computer can use to connect to the target computer.
For more information, see:
The 1394 transport is available for use in Windows 10, version 1607 and earlier. It is not available in later versions of Windows. You should transition your projects to other transports, such as KDNET using Ethernet. For more information about that transport, see Setting Up KDNET Network Kernel Debugging Automatically.
Specifies that the target machine and the host machine will use an IEEE 1394 (FireWire) connection for debugging. When this option is used, the CHANNEL parameter can be included as well.
CHANNEL:channel
(Only used when the connection type is 1394.) Specifies the 1394 channel to use. The value for channel must be a decimal integer between 0 and 62, inclusive, and must match the channel number used by the host computer. The channel specified in this parameter does not depend on the physical 1394 port chosen on the adapter. The default value for channel is 0.
General Debugger Settings
/start startpolicy
This option specifies the debugger start policy. The following table shows the options for the startpolicy.
Option | Description |
---|---|
ACTIVE | Specifies that the kernel debugger is active. |
AUTOENABLE | Specifies that the kernel debugger is enabled automatically when an exception or other critical event occurs. Until then, the debugger is active but is disabled. |
DISABLE | Specifies that the kernel debugger is enabled when you type kdbgctrl to clear the enable block. Until then, the debugger is active but is disabled. |
If a start policy is not specified, ACTIVE is the default.
/noumex
Specifies that the kernel debugger ignores user-mode exceptions. By default, the kernel debugger breaks for certain user-mode exceptions, such as STATUS_BREAKPOINT and STATUS_SINGLE_STEP. The /noumex parameter is effective only when there is no user-mode debugger attached to the process.
Comments
The /dbgsettings option configures the debugging settings, but does not enable debugging. You must use the /debug option to enable debugging for a specific boot entry. If there are no debugging settings specified for a particular boot entry, the default debug settings are used.
The default values for the dbgsettings are shown in the following table.
dbgsetting parameter | Default value |
---|---|
debugtype | Local |
debugstart | Active |
noumex | Yes |
See also
For information about Windows debugging tools, see Windows Debugging.
For information about setting up and configuring a kernel-mode debugging session, see Setting Up Kernel-Mode Debugging Manually and Setting Up KDNET Network Kernel Debugging Automatically.
BCDEdit /bootdebug
The /bootdebug boot option enables or disables boot debugging of the current or specified Windows operating system boot entry.
Parameters
The <ID> is the ID that is associated with the boot entry, such as
on
Enables boot debugging of the specified boot entry. If a boot entry is not specified, boot debugging is enabled for the current operating system.
off
Disables boot debugging of the specified boot entry. If a boot entry is not specified, boot debugging is disabled for the current operating system.
Before setting BCDEdit options you might need to disable or suspend BitLocker and Secure Boot on the computer.
Comments
The /bootdebug boot option enables boot debugging for a specific boot entry. Use the /dbgsettings option to configure the type of debugging connection (debugtype) to use and the connection parameters.
The default values for the dbgsettings are shown in the following table.
dbgsetting parameter | Default value |
---|---|
debugtype | Local |
debugstart | Active |
noumex | Yes |
The following command enables boot debugging of the Windows boot loader for the current operating system. The Windows boot loader (Winload.exe) controls the load UI and loads the kernel boot drivers.
The following command disables boot debugging of Windows Boot Manager (Bootmgr.exe). Windows Boot Manager selects which operating system will start, and then loads the Windows boot loader.
In the following example, the commands enable debugging of Windows Boot Manager, the boot loader, and then kernel debugging of the operating system. This combination allows debugging at every stage of startup. If this combination is used, the target computer will break into the debugger three times: when Windows Boot Manager loads, when the boot loader loads, and when the operating system starts up.
For general information about Windows debugging tools, see Windows Debugging.
BCDEdit Command-Line Options
BCDEdit is a command-line tool for managing Boot Configuration Data (BCD).
BCD files provide a store that is used to describe boot applications and boot application settings.
BCDEdit can be used for a variety of purposes, including creating new stores, modifying existing stores, adding boot menu options, and so on.
You’ll need administrative privileges to use BCDEdit to modify BCD. Start the Command Prompt (Admin) or use Windows PE.
A normal shutdown and reboot is necessary to ensure that any modified BCDEdit settings are flushed to disk.
BCDEdit is included in the %WINDIR%\System32 folder.
BCDEdit is limited to the standard data types and is designed primarily to perform single common changes to BCD. Related resources:
- Some common BCD operations, such as recovering a partition or setting up a new PC’s system partition, may be more easily accomplished by using BCDboot.
- For complex operations or nonstandard data types, consider using the BCD Windows Management Instrumentation (WMI) application programming interface (API) to create more powerful and flexible custom tools.
BCDEdit Command-Line Options
The following command-line options are available for BCDEdit.exe.
BCDEdit /Command[Argument1] [Argument2] .
Option | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
/? [commmand] |
Option | Description |
---|---|
/createstore | Creates a new empty boot configuration data store. The created store is not a system store. |
/export | 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 valid only for the system store. |
/import | Restores the state of the system store by using a backup data file previously generated by using the /export option. This command deletes any existing entries in the system store before the import takes place. This command is valid only for the system store. |
/store | This option can be used with most BCDedit commands to specify the store to be used. If this option is not specified, then BCDEdit operates on the system store. Running the bcdedit /store command by itself is equivalent to running the bcdedit /enum active command. |
/sysstore | Sets the system store device. This only affects EFI-based systems. It does not persist across reboots, and is only used in cases where the system store device is ambiguous. |
Operating on entries in a store
Option | Description |
---|---|
/copy | Makes a copy of a specified boot entry in the same system store. |
/create | Creates a new entry in the boot configuration data store. If a well-known identifier is specified, then the /application, /inherit, and /device options cannot be specified. If an identifier is not specified or not well known, an /application, /inherit, or /device option must be specified. |
/delete | Deletes an element from a specified entry. |
/mirror | Creates mirror of entries in the store. |
Changing entry options
Option | Description |
---|---|
/deletevalue | Deletes a specified element from a boot entry. |
/set | Sets an entry option value. |
For example, this command will enable the system to trust Windows Insider Preview builds that are signed with certificates that are not trusted by default:
Reboot after running the command. To turn off flightsigning:
Controlling output
Option | Description |
---|---|
/enum | Lists entries in a store. The /enum option is the default value for BCEdit, so running the bcdedit command without options is equivalent to running the bcdedit /enum active command. |
/v | Verbose mode. Usually, any well-known entry identifiers are represented by their friendly shorthand form. Specifying /v as a command-line option displays all identifiers in full. |
Running the bcdedit /v command by itself is equivalent to running the bcdedit /enum active /v command.
Controlling the boot manager
Option | Description |
---|---|
/bootsequence | Specifies a one-time display order to be used for the next boot. This command is similar to the /displayorder option, except that it is used only the next time the computer starts. Afterwards, the computer reverts to the original display order. |
/default | Specifies the default entry that the boot manager selects when the timeout expires. |
/displayorder | Specifies the display order that the boot manager uses when displaying boot options to a user. |
/timeout | Specifies the time to wait, in seconds, before the boot manager selects the default entry. |
/toolsdisplayorder | Specifies the display order for the boot manager to use when displaying the Tools menu. |
Emergency Management Services options
Option | Description |
---|---|
/bootems | Enables or disables Emergency Management Services (EMS) for the specified entry. |
/ems | Enables or disables EMS for the specified operating system boot entry. |
/emssettings | Sets the global EMS settings for the computer. /emssettings does not enable or disable EMS for any particular boot entry. |
Debugging
Option | Description |
---|---|
/bootdebug | Enables or disables the boot debugger for a specified boot entry. Although this command works for any boot entry, it is effective only for boot applications. |
/dbgsettings | Specifies or displays the global debugger settings for the system. This command does not enable or disable the kernel debugger; use the /debug option for that purpose. To set an individual global debugger setting, use the bcdedit /setdbgsettings type value command. |
/debug | Enables or disables the kernel debugger for a specified boot entry. |
/hypervisorsettings | Sets the hypervisor parameters. |
To troubleshoot a new installation, enable debug mode by modifying the boot configuration file (BCD). For example, use the following syntax to enable kernel or boot debug.
where is the GUID of the Loader object that is used to load the operating system. «Default» can be used if the operating system is the default option of the Boot Manager menu.