BCDEDIT – Boot Configuration Data Store Editor

I recently had to troubleshoot an interesting problem which required me to reboot a server into safe mode a number of times. While I was hammering away on the F8 key during the boot phase I wondered if there was a different way to change the boot menu to avoid the key spamming. That’s what brought my attention to the bcdedit command and I decided it would be useful to write a post on this as I haven’t ever used it before. The server was in a state where the desktop would not load, nor anything but task manager and a command prompt. Attempting to open other tools resulted in ‘problems’. As I only had a command line to work with I figured why not find out a new way to set entering safe mode.

 

What is bcdedit?

Let’s start off with the text from Microsoft describing bcdedit –

The Bcdedit.exe 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 operating systems). You can use Bcdedit.exe to add, delete, edit, and append entries in the boot configuration data store.

Basically we can edit the boot options to, for example, set the system to boot into safe mode without having to hammer the F8 key and select it. This can be rather handy, especially with physical servers that take a long time to boot and leave you sat on an IMPI console waiting for just the right moment to spam the key. In older versions of Windows (prior to Vista) we would modify the boot.ini file as indicated above. This command line tool was exactly what I needed to modify the boot order to save me having to pres F8 repeatedly during the boot phase.

bcdedit Command Line Options

Next we can take a look at the available command options –

C:\>bcdedit /?

BCDEDIT - Boot Configuration Data Store Editor

The v 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 operating systems). You can use Bcdedit.exe to add, delete, edit, and append entries in the boot configuration data store.

For detailed command and option information, type bcdedit.exe /? <command>. For example, to display detailed information about the /createstore command, type:

bcdedit.exe /? /createstore

For an alphabetical list of topics in this help file, run "bcdedit /? TOPICS".

Commands that operate on a store
================================
/createstore Creates a new and empty boot configuration data store.
/export Exports the contents of the system store to a file. This file
can be used later to restore the state of the system store.
/import Restores the state of the system store using a backup file
created with the /export command.
/sysstore Sets the system store device (only affects EFI systems, does
not persist across reboots, and is only used in cases where
the system store device is ambiguous).

Commands that operate on entries in a store
===========================================
/copy Makes copies of entries in the store.
/create Creates new entries in the store.
/delete Deletes entries from the store.
/mirror Creates mirror of entries in the store.

Run bcdedit /? ID for information about identifiers used by these commands.

Commands that operate on entry options
======================================
/deletevalue Deletes entry options from the store.
/set Sets entry option values in the store.

Run bcdedit /? TYPES for a list of datatypes used by these commands.
Run bcdedit /? FORMATS for a list of valid data formats.

Commands that control output
============================
/enum Lists entries in the store.
/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.

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

Commands that control the boot manager
======================================
/bootsequence Sets the one-time boot sequence for the boot manager.
/default Sets the default entry that the boot manager will use.
/displayorder Sets the order in which the boot manager displays the
multiboot menu.
/timeout Sets the boot manager time-out value.
/toolsdisplayorder Sets the order in which the boot manager displays
the tools menu.

Commands that control Emergency Management Services for a boot application
==========================================================================
/bootems Enables or disables Emergency Management Services
for a boot application.
/ems Enables or disables Emergency Management Services for an
operating system entry.
/emssettings Sets the global Emergency Management Services parameters.

Command that control debugging
==============================
/bootdebug Enables or disables boot debugging for a boot application.
/dbgsettings Sets the global debugger parameters.
/debug Enables or disables kernel debugging for an operating system
entry.
/hypervisorsettings Sets the hypervisor parameters.

We can reference an MSDN article to see how the boot.ini options map to BCDEdit options –

Boot.ini BCDEdit option BCD element type

/3GB

increaseuserva

BcdOSLoaderInteger_IncreaseUserVa

/BASEVIDEO

vga

BcdOSLoaderBoolean_UseVgaDriver

/BOOTLOG

bootlog

BcdOSLoaderBoolean_BootLogInitialization

/BREAK

halbreakpoint

BcdOSLoaderBoolean_DebuggerHalBreakpoint

/CRASHDEBUG

/dbgsettings /start

/DEBUG, BOOTDEBUG

/debug

/bootdebug

BcdLibraryBoolean_DebuggerEnabled

/DEBUG

/debug

BcdOSLoaderBoolean_KernelDebuggerEnabled

/DEBUG, /DEBUGPORT=

/dbgsettings

BcdLibraryInteger_DebuggerType

/DEBUGPORT=

/dbgsettings

BcdLibraryInteger_SerialDebuggerPort

BcdLibraryInteger_SerialDebuggerBaudRate

BcdLibraryInteger_1394DebuggerChannel

BcdLibraryString_UsbDebuggerTargetName

BcdLibraryInteger_DebuggerNetHostIP

BcdLibraryInteger_DebuggerNetPort

BcdLibraryBoolean_DebuggerNetDhcp

BcdLibraryString_DebuggerNetKey

/EXECUTE

nx

BcdOSLoaderInteger_NxPolicy

/FASTDETECT

/HAL=

hal

BcdOSLoaderString_HalPath

/KERNEL=

kernel

BcdOSLoaderString_KernelPath

/MAXMEM=

truncatememory

BcdLibraryInteger_TruncatePhysicalMemory

/NODEBUG

/debug

/NOEXECUTE

nx {

BcdOSLoaderInteger_NxPolicy

/NOGUIBOOT

quietboot

BcdOSLoaderBoolean_DisableBootDisplay

/NOLOWMEM

nolowmem

BcdOSLoaderBoolean_NoLowMemory

/NOPAE

pae

BcdOSLoaderInteger_PAEPolicy

/ONECPU

onecpu

BcdOSLoaderBoolean_UseBootProcessorOnly

/PAE

pae

BcdOSLoaderInteger_PAEPolicy

/PCILOCK

usefirmwarepcisettings

BcdOSLoaderInteger_UseFirmwarePciSettings

/REDIRECT

/ems

/emssettings [ BIOS ] |

EMSPORT:{port} | [EMSBAUDRATE:{baudrate}] ]

BcdOSLoaderBoolean_EmsEnabled

/SOS

sos

What other tool might I use?

The msconfig tool in Windows is another way to make changes to these settings –

System Configuration GeneralSystem Configuration Boot

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.