cheat sheet

bcdedit

View and modify the Windows Boot Configuration Data store — manage boot entries, set default OS, change timeouts, enable debugging, and configure boot options from an elevated command prompt.

bcdedit — Boot Configuration Data Editor

What it is

bcdedit (Boot Configuration Data Editor) is a built-in Windows tool that reads and writes the Boot Configuration Data (BCD) store — the structured database that the Windows Boot Manager uses to find, enumerate, and launch operating system boot loaders. Use it to add or remove boot entries, set the default OS on a multi-boot system, change the boot timeout, enable kernel debugging, or disable driver signature enforcement (test-signing mode). Requires Administrator privileges. Incorrect edits can make a system unbootable; always export a backup before making changes.

Availability

bcdedit ships as C:\Windows\System32\bcdedit.exe on Windows Vista and later. Must be run as Administrator.

cmd
bcdedit /?

Output:

sql
BCDEDIT - Boot Configuration Data Store Editor

The command-line tool controls the boot configuration data store.
...

Commands that operate on a store:
/store          Used to specify a BCD store other than the current system default.

Commands that operate on entries in a store:
/copy           Makes a copy of an entry in the specified store.
/create         Creates a new entry in the store.
/delete         Deletes an entry from the store.
/mirror         Creates a mirror of an entry in the store.
...

Syntax

cmd
bcdedit [/store file] /option [arguments]

Output: (varies by option)

Essential options

SwitchMeaning
/enum [type]List all BCD entries (default: ACTIVE)
/default {id}Set the default boot entry by GUID
/timeout NSet boot menu timeout in seconds
/set {id} key valueSet a property on a boot entry
/deletevalue {id} keyRemove a property from a boot entry
/copy {id} /d "description"Copy an entry with a new description
/create /d "desc" /application osloaderCreate a new boot entry
/delete {id}Delete a boot entry
/export fileExport the BCD store to a file
/import fileRestore a BCD store from a backup file
/dbgsettingsShow or set kernel debugger settings
`/debug {id} onoff`
`/bootdebug {id} onoff`
`/testsigning onoff`
`/set {id} safeboot minimalnetwork

Viewing the BCD store

/enum all lists every object in the BCD store — Windows Boot Manager, boot loaders, and any firmware entries.

cmd
bcdedit /enum all

Output:

sql
Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume1
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
default                 {current}
resumeobject            {a1b2c3d4-...}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Windows 11
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {e5f6g7h8-...}
displaymessageoverride  Recovery
recoveryenabled         Yes
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \Windows
resumeobject            {a1b2c3d4-...}
nx                      OptIn
bootmenupolicy          Standard

Setting the boot timeout

The boot menu countdown in seconds. 0 boots immediately with no user interaction; -1 waits indefinitely.

cmd
bcdedit /timeout 10

Output:

code
The operation completed successfully.

Changing the default boot entry

On multi-boot systems, /default sets which entry boots automatically when the timeout expires.

cmd
rem List entries to get their GUIDs first
bcdedit /enum

Output:

markdown
Windows Boot Loader
-------------------
identifier              {current}
description             Windows 11

Windows Boot Loader
-------------------
identifier              {a1b2c3d4-e5f6-7890-abcd-ef1234567890}
description             Windows 10
cmd
bcdedit /default {a1b2c3d4-e5f6-7890-abcd-ef1234567890}

Output:

code
The operation completed successfully.

Modifying boot entry properties (/set)

/set changes any property of a boot entry. Common keys: description, path, systemroot, nx, nointegritychecks, testsigning, safeboot, bootmenupolicy.

cmd
rem Rename the current boot entry
bcdedit /set {current} description "Windows 11 Pro (Production)"

Output:

code
The operation completed successfully.
cmd
rem Disable Secure Boot check for a test entry
bcdedit /set {current} nointegritychecks yes

Output:

code
The operation completed successfully.

Enabling test-signing mode

Test-signing allows loading drivers not signed by a trusted authority — used in driver development. Enabling it adds a watermark to the desktop and lowers system security; never leave it on in production.

cmd
bcdedit /set testsigning on

Output:

code
The operation completed successfully.
cmd
rem Disable when development is done
bcdedit /set testsigning off

Output:

code
The operation completed successfully.

Booting into Safe Mode

Setting the safeboot value on the current entry forces Safe Mode on the next reboot. Remove the value to return to normal boot.

cmd
bcdedit /set {current} safeboot minimal

Output:

code
The operation completed successfully.
cmd
rem Reboot into Safe Mode now
shutdown /r /t 0

Output:

perl
(system reboots)
cmd
rem Remove safeboot flag after recovery (run from Safe Mode)
bcdedit /deletevalue {current} safeboot

Output:

code
The operation completed successfully.

Enabling kernel debugging

Kernel debugging connects a host debugger to the target machine over serial, network, USB, or 1394. /dbgsettings configures the transport; /debug on enables it for a specific entry.

cmd
rem Configure network debugging (kdnet)
bcdedit /dbgsettings net hostip:192.168.1.200 port:50000

Output:

ini
Key=1a2b3c4d5e6f7890.1a2b3c4d5e6f7890.1a2b3c4d5e6f7890.1a2b3c4d5e6f7890
The operation completed successfully.
cmd
bcdedit /debug {current} on

Output:

code
The operation completed successfully.

Exporting and importing the BCD store

Always export the BCD store before making changes. The export is a binary file that can be restored with /import if a change breaks boot.

cmd
bcdedit /export C:\Backup\bcd_backup_%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%.bcd

Output:

code
The operation completed successfully.
cmd
rem Restore from backup (run from Windows Recovery Environment)
bcdedit /import C:\Backup\bcd_backup_20260428.bcd

Output:

code
The operation completed successfully.

Common pitfalls

  1. A bad edit can make the system unbootable — always run /export before any change; the Windows Recovery Environment (winre) has bcdedit available for repair.
  2. {current} refers to the running OS entry — it is an alias, not a literal GUID; using it in a script is safer than hardcoding the GUID.
  3. Test-signing lowers security — loading test-signed drivers bypasses signature enforcement; revert with bcdedit /set testsigning off when done and reboot.
  4. /timeout 0 gives no time to choose — on a multi-boot system, setting timeout to 0 means the default entry always boots with no chance to interrupt; use at least 5 seconds.
  5. safeboot persists across reboots — if you set safeboot minimal and reboot into Safe Mode, remember to remove the value before rebooting again or you'll always boot into Safe Mode.
  6. Secure Boot may block changes — on UEFI systems with Secure Boot enabled, some bcdedit changes (e.g. nointegritychecks) are ignored; disable Secure Boot in firmware if needed for driver development.

Real-world recipes

Before any change — export the BCD store

cmd
md C:\BCDBackup 2>NUL
bcdedit /export "C:\BCDBackup\bcd_%COMPUTERNAME%_%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%.bcd"
echo BCD exported.

Output:

code
The operation completed successfully.
BCD exported.

Set boot timeout for a kiosk machine

cmd
bcdedit /timeout 5
bcdedit /default {current}
echo Boot configured: 5-second timeout, defaults to current OS.

Output:

sql
The operation completed successfully.
The operation completed successfully.
Boot configured: 5-second timeout, defaults to current OS.

Force Safe Mode for next reboot then auto-remove

cmd
@echo off
bcdedit /set {current} safeboot minimal
echo Safe Mode set. Rebooting in 10 seconds...
shutdown /r /t 10

Output:

arduino
The operation completed successfully.
Safe Mode set. Rebooting in 10 seconds...

Anatomy of the BCD store

The BCD (Boot Configuration Data) store is a hive — the same registry-style binary format used by HKLM keys. On a normal install it lives at \EFI\Microsoft\Boot\BCD on the EFI System Partition for UEFI systems, or \Boot\BCD on the system-reserved partition for legacy BIOS installs. Each entry inside is identified by a GUID and described by a fixed set of element keys. Understanding this structure makes bcdedit /enum output legible: a "Windows Boot Manager" object plus one or more "Windows Boot Loader" objects, each tied together by displayorder and default references.

cmd
rem Show the BCD file path on a UEFI machine
mountvol S: /S
dir S:\EFI\Microsoft\Boot\BCD

Output:

php
 Directory of S:\EFI\Microsoft\Boot

03/14/2026  09:14         24,576 BCD
Object typeIdentifier aliasPurpose
Windows Boot Manager{bootmgr}Top-level — shows menu, transfers control
Firmware Boot Manager{fwbootmgr}UEFI firmware boot order
Windows Boot Loader{current}, {default}, {<GUID>}One per installed OS
Windows Resume from Hibernate{<GUID>}Linked from each OS via resumeobject
Memory Diagnostic{memdiag}The "Memory Test" entry
Global Settings{globalsettings}Shared defaults for all loaders
Boot Loader Settings{bootloadersettings}Inherited by every loader
Hypervisor Settings{hypervisorsettings}Hyper-V hypervisor boot config
Bad Memory{badmemory}List of bad RAM addresses to skip
EMS Settings{emssettings}Emergency Management Services
Debugger Settings{dbgsettings}Kernel debugger transport

GUID aliases — the well-known identifiers

bcdedit accepts both raw GUIDs and a set of named aliases. Using aliases in scripts is portable across machines because the underlying GUIDs differ per install.

AliasMeans
{bootmgr}The Windows Boot Manager itself
{fwbootmgr}The UEFI firmware boot manager
{current}The boot loader entry that booted the running OS
{default}The currently-default boot entry (may differ from {current})
{memdiag}The Windows Memory Diagnostic entry
{ntldr}Legacy NTLDR (XP, 2003) entry — present only on multi-boot upgrades
{ramdiskoptions}Options for ramdisk-based boots (WinPE, recovery)
{dbgsettings}Debugger settings shared object
{emssettings}Emergency Management Services settings
{badmemory}Bad-memory blacklist
{globalsettings}Global settings inherited by Boot Manager
{bootloadersettings}Defaults inherited by every OS loader
{hypervisorsettings}Hyper-V hypervisor settings
{resumeloadersettings}Defaults inherited by resume-from-hibernate loaders
cmd
rem List just the boot manager
bcdedit /enum {bootmgr}

Output:

sql
Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume1
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
default                 {current}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

/enum filter types

/enum takes an optional category filter that scopes the output.

/enum argumentShows
ACTIVE (default)Active entries in displayorder
FIRMWAREUEFI firmware entries
BOOTAPPBoot applications (e.g. memtest)
BOOTMGRJust the Windows Boot Manager
OSLOADERAll Windows OS loaders
RESUMEResume-from-hibernate entries
INHERITInheritable setting objects
ALLEvery object in the store
cmd
bcdedit /enum OSLOADER

Output:

markdown
Windows Boot Loader
-------------------
identifier              {current}
description             Windows 11
...

Windows Boot Loader
-------------------
identifier              {a1b2c3d4-...}
description             Windows 10
cmd
bcdedit /enum FIRMWARE

Output:

markdown
Firmware Boot Manager
---------------------
identifier              {fwbootmgr}
displayorder            {bootmgr}
                        {a1b2c3d4-...}
timeout                 1

Complete switch reference

CategorySwitchPurpose
Store/store <file>Operate on a non-system BCD file
Store/createstore <file>Create a new empty BCD store
Store/sysstore <drive>Set the system store device
Store/import <file>Restore from a backup
Store/import <file> /cleanRestore and wipe firmware entries
Store/export <file>Dump the current store
Entry/copy <id> /d "<desc>"Clone an entry with new description
Entry/create <id> /d "<desc>"Create with a specific GUID
Entry/create /d "<desc>" /application <type>Create new application entry
Entry/create /d "<desc>" /deviceCreate a device options entry
Entry/create /d "<desc>" /inheritCreate an inherit settings entry
Entry/delete <id>Remove an entry
Entry/delete <id> /cleanupRemove and clean references
Entry/delete <id> /fForce delete a well-known entry
Entry/mirror <id>Make a mirror clone
Element/set <id> <element> <value>Set a property
Element/deletevalue <id> <element>Remove a property
Order`/displayorder [/addfirst/addlast
Order/bootsequence <id> ...One-time boot order
Order/toolsdisplayorder <id> ...Tools menu order
Order/default <id>Set the default
Boot Manager/timeout NBoot menu countdown (seconds)
Boot Manager`/bootems onoff`
Debug/dbgsettings <type> ...Set kernel debugger transport
Debug`/debug onoff`
Debug`/bootdebug onoff`
Debug`/ems onoff`
Debug/emssettings ...EMS global config
Debug/hypervisorsettings <type> ...Hypervisor debugger
Event log/eventsettings ...Boot event logging
Event log`/event onoff`
Security`/set testsigning onoff`
Misc/vVerbose — show full GUIDs
Misc/?Help
Misc/? /<topic>Topic-specific help
cmd
rem Verbose mode — full GUIDs instead of {current}
bcdedit /enum /v

Output:

markdown
Windows Boot Loader
-------------------
identifier              {12345678-1234-1234-1234-123456789abc}
device                  partition=C:
description             Windows 11
...

Boot entry elements (settable with /set)

Each Windows Boot Loader entry has a fixed schema of typed elements. The most useful ones for day-to-day tweaking:

ElementTypeMeaning
descriptionstringMenu label
devicepartitionWhere the OS files live
osdevicepartitionOS partition
pathstringBoot file path (\Windows\system32\winload.exe)
systemrootstringOS root (\Windows)
localestringUI language (e.g. en-US)
inheritguidParent inherit-settings object
recoveryenabledboolShow recovery on failure
recoverysequenceguidLinked recovery entry
bootmenupolicyenumLegacy (F8 menu) or Standard (touch-friendly)
bootstatuspolicyenumDisplayAllFailures, IgnoreAllFailures, IgnoreShutdownFailures, IgnoreBootFailures, IgnoreCheckpointFailures, DisplayShutdownFailures, DisplayBootFailures, DisplayCheckpointFailures — controls whether failed boots/shutdowns/checkpoints push the system into WinRE on next reboot
onetimeadvancedoptionsboolOne-shot F8 (legacy advanced options) menu at next boot only
vsmlaunchtypeenumAuto or Off — controls Virtual Secure Mode launch (Credential Guard, HVCI / Memory Integrity)
disableelamdriversboolBlocks Early Launch Antimalware drivers from loading — only triggerable from the F8 menu; OS loader removes the entry on subsequent boots
hypervisorrootprocintegerMaximum virtual processors in the root partition (Hyper-V)
hypervisorrootprocpernodeintegerRoot-partition virtual processors per pre-split NUMA node
hypervisoriommupolicyenumdefault, enable, or disable — controls hypervisor use of the IOMMU
nxenumDEP: OptIn, OptOut, AlwaysOn, AlwaysOff
paeenumPhysical Address Extension
safebootenumMinimal, Network, DsRepair
safebootalternateshellboolSafe Mode with Command Prompt
noexecuteenumAlias for nx
nointegritychecksboolDisable driver-signature enforcement
testsigningboolAllow test-signed drivers (system-wide flag)
hypervisorlaunchtypeenumAuto or Off — controls Hyper-V load
disabledynamictickboolDisable dynamic timer for Hyper-V
useplatformclockboolForce HPET clock
numprocintegerLimit logical processors at boot
truncatememoryintegerCap RAM at N bytes (debugging)
removememoryintegerSubtract N bytes of RAM
firstmegabytepolicyenumHandling of first 1 MB
quietbootboolSuppress the rotating logo
bootlogboolWrite %WINDIR%\ntbtlog.txt
sosboolShow driver names at boot
winpeboolMark as Windows PE
loadoptionsstringFree-form boot parameters
tpmbootentropyenumTPM entropy collection
usefirmwarepcisettingsboolUse firmware PCI config
useefisettingsboolUse EFI variable settings
cmd
rem Show every element for {current}
bcdedit /enum {current} /v

Output:

ini
Windows Boot Loader
-------------------
identifier              {12345678-...}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Windows 11
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {abcdef01-...}
displaymessageoverride  Recovery
recoveryenabled         Yes
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \Windows
resumeobject            {fedcba98-...}
nx                      OptIn
bootmenupolicy          Standard

Diagnostic boot modes via /set

A range of one-off diagnostic flags can be flipped via /set on the {current} entry. They persist until you /deletevalue them.

cmd
rem Verbose driver list at boot
bcdedit /set {current} sos yes

rem Boot log written to %WINDIR%\ntbtlog.txt
bcdedit /set {current} bootlog yes

rem Limit to 2 logical processors for debugging multi-CPU issues
bcdedit /set {current} numproc 2

rem Cap RAM at 4 GB for memory-limit testing
bcdedit /set {current} truncatememory 0x100000000

rem Force HPET timer (Hyper-V troubleshooting)
bcdedit /set {current} useplatformclock true

rem Disable hypervisor (turns off Hyper-V at boot)
bcdedit /set hypervisorlaunchtype off

Output (each):

code
The operation completed successfully.

Remove with /deletevalue:

cmd
bcdedit /deletevalue {current} sos
bcdedit /deletevalue {current} bootlog
bcdedit /deletevalue {current} numproc
bcdedit /deletevalue {current} truncatememory
bcdedit /deletevalue {current} useplatformclock
bcdedit /set hypervisorlaunchtype auto

Output (each):

code
The operation completed successfully.

Working with offline BCD stores (/store)

/store <file> operates on a BCD file other than the active system store. This is the primary way to repair an unbootable Windows from inside the Windows Recovery Environment (WinRE), or to edit a virtual machine's BCD from the host without booting the VM.

cmd
rem In WinRE — locate the system partition
diskpart
DISKPART> list volume
DISKPART> exit

rem Edit the BCD on the recovered partition
bcdedit /store S:\EFI\Microsoft\Boot\BCD /enum

Output:

markdown
Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume1
...
cmd
rem Set the default boot entry in an offline store
bcdedit /store S:\EFI\Microsoft\Boot\BCD /default {current}

Output:

code
The operation completed successfully.

For editing a VHD's BCD on the host without booting it, Mount-DiskImage makes the VHD's partitions available as drive letters, after which /store <drive>:\Boot\BCD works on the offline image.

powershell
# PowerShell — mount a VHDX read-write
$mounted = Mount-DiskImage -ImagePath "C:\VMs\client.vhdx" -PassThru
$drive = ($mounted | Get-Disk | Get-Partition | Get-Volume | Where-Object DriveLetter).DriveLetter
Write-Host "VHD mounted on $drive`:"

Output:

csharp
VHD mounted on G:
cmd
rem Now edit its BCD from the host
bcdedit /store G:\Boot\BCD /enum
bcdedit /store G:\Boot\BCD /timeout 5

Output:

code
The operation completed successfully.
powershell
# Dismount when done
Dismount-DiskImage -ImagePath "C:\VMs\client.vhdx"

Output:

yaml
Attached          : False
DevicePath        :
...

Creating boot entries — VHD boot

bcdedit can configure a Windows install inside a VHD/VHDX file to boot natively (no hypervisor). This is occasionally useful for testing OS images or running a sandboxed Windows installation.

cmd
rem Copy the running OS entry as a starting template
for /F "tokens=2 delims={}" %%G in ('bcdedit /copy {current} /d "Windows 11 VHD" ^| findstr "successfully copied"') do set NEWID={%%G}

rem Tell the new entry that its OS files live inside a VHD
bcdedit /set %NEWID% device vhd=[C:]\VHDs\test.vhdx
bcdedit /set %NEWID% osdevice vhd=[C:]\VHDs\test.vhdx
bcdedit /set %NEWID% description "Windows 11 (VHD)"

rem Add to the menu
bcdedit /displayorder %NEWID% /addlast
bcdedit /timeout 10

Output (each successful command):

code
The operation completed successfully.

After reboot, the boot menu offers both the host OS and the VHD-resident OS.

Virtual Secure Mode and Credential Guard (vsmlaunchtype)

Virtual Secure Mode (VSM) is the hypervisor-isolated execution environment that hosts Credential Guard, Hypervisor-protected Code Integrity (HVCI / Memory Integrity), and other VBS (Virtualization-Based Security) features. On Windows 11 22H2 and later, VSM is on by default on hardware that supports it. bcdedit /set vsmlaunchtype toggles the boot-time launch — pair with hypervisorlaunchtype since VSM rides on top of the hypervisor.

cmd
rem Disable Virtual Secure Mode at next boot (e.g. to use a third-party hypervisor)
bcdedit /set vsmlaunchtype off

rem Re-enable
bcdedit /set vsmlaunchtype auto

Output (each):

code
The operation completed successfully.
powershell
# Check current VBS / Credential Guard status (msinfo32 also surfaces this)
Get-CimInstance -ClassName Win32_DeviceGuard -Namespace root\Microsoft\Windows\DeviceGuard |
    Select-Object SecurityServicesRunning, VirtualizationBasedSecurityStatus, RequiredSecurityProperties

Output:

yaml
SecurityServicesRunning : {1, 2}
VirtualizationBasedSecurityStatus : 2
RequiredSecurityProperties        : {1, 2, 3}

A VirtualizationBasedSecurityStatus of 2 means VBS is enabled and running. Note: disabling Credential Guard properly also requires the WDAG/Credential-Guard removal tool — toggling vsmlaunchtype alone leaves an inconsistent state on machines provisioned via Intune/MDM policy.

Boot status policy (bootstatuspolicy)

bootstatuspolicy controls whether a failed boot, failed shutdown, or failed checkpoint forces the machine into the Windows Recovery Environment on the next reboot. The default on Windows 8 and later is IgnoreShutdownFailures — boot/checkpoint failures still trigger WinRE, but a hard power-off does not. On unattended servers in a remote data centre, IgnoreAllFailures prevents a single bad boot from stranding the machine in WinRE with no console operator to dismiss the recovery prompt.

cmd
rem Suppress all WinRE auto-recovery prompts (use only on monitored servers)
bcdedit /set {default} bootstatuspolicy IgnoreAllFailures

Output:

code
The operation completed successfully.
cmd
rem Restore the default (boot/checkpoint failures still trigger WinRE)
bcdedit /set {default} bootstatuspolicy IgnoreShutdownFailures

Output:

code
The operation completed successfully.

One-shot F8 menu (onetimeadvancedoptions)

On a Windows 8 / 10 / 11 system with bootmenupolicy Standard, the legacy F8 menu is permanently disabled. onetimeadvancedoptions on re-enables the F8 menu for the next boot only — handy when you need Safe Mode access on a remote machine without permanently switching the boot menu policy.

cmd
bcdedit /set {current} onetimeadvancedoptions on
shutdown /r /t 0

Output:

code
The operation completed successfully.

After the reboot, the F8 advanced options menu is available; subsequent boots return to the touch-friendly Standard menu automatically.

bcdedit and Secure Boot

UEFI Secure Boot prevents loading boot loaders that aren't signed by trusted certificates. Some bcdedit changes (testsigning on, nointegritychecks yes) require Secure Boot to be off — when Secure Boot is on, Windows ignores the flag and continues to enforce signatures. The fix is to disable Secure Boot in the UEFI firmware setup before setting the flag, then re-enable it once development is done.

cmd
rem Check current Secure Boot status (PowerShell helper)
powershell -NoProfile -Command "Confirm-SecureBootUEFI"

Output:

graphql
True

(True means Secure Boot is enabled and testsigning will be silently ignored.)

cmd
rem After turning Secure Boot off in firmware:
bcdedit /set testsigning on
bcdedit /set {current} nointegritychecks yes

Output:

code
The operation completed successfully.

A "Test Mode" watermark appears in the bottom-right of the desktop while these flags are active.

Hyper-V and hypervisorlaunchtype

The hypervisorlaunchtype element on the boot manager controls whether the Hyper-V hypervisor is loaded before Windows. Setting it to off is required before installing certain other hypervisors (VMware Workstation pre-15, VirtualBox pre-6) and to use Intel VT-d / AMD-Vi directly from the host OS.

cmd
rem Disable Hyper-V at next boot
bcdedit /set hypervisorlaunchtype off

rem Re-enable
bcdedit /set hypervisorlaunchtype auto

Output (each):

code
The operation completed successfully.

Reboot is required for the change to take effect. Note that Windows 10/11 with Virtualization-Based Security (Memory Integrity, Credential Guard) enabled may re-enable Hyper-V automatically; check via msinfo32 after reboot.

bcdedit and bcdboot

bcdedit modifies entries that already exist; it does not create the BCD itself or copy boot files. The companion tool bcdboot does both — it copies boot files to the EFI System Partition and seeds a fresh BCD with an entry for the specified OS. Use bcdboot when:

  • Repairing a wiped EFI System Partition.
  • Adding a freshly applied WIM to the boot menu.
  • Creating a USB-bootable rescue stick.
cmd
rem Re-create boot files for the Windows install on C:\
bcdboot C:\Windows /s S: /f UEFI

Output:

code
Boot files successfully created.
ActionTool
Modify an existing entrybcdedit
Create a new entry from scratchbcdedit /create or bcdboot
Repair the EFI System Partitionbcdboot
Set the defaultbcdedit /default
Switch firmware type (BIOS↔UEFI)`bcdboot /f BIOS
Reset the BCD entirelybcdedit /createstore + bcdboot

PowerShell — no native equivalent

Unlike most Windows CLI tools, bcdedit has no first-party PowerShell module. The reason is that the underlying BCD WMI provider (root\WMI\BcdObject) is awkward enough that Microsoft never wrapped it in cmdlets. Real PowerShell automation either shells out to bcdedit and parses output, or talks to WMI directly.

powershell
# Shell out to bcdedit and capture
$out = bcdedit /enum
$out -split "`r`n" | Where-Object { $_ -match "^description" }

Output:

code
description             Windows Boot Manager
description             Windows 11
description             Windows 10
powershell
# Talk to WMI directly — read the active OS loader
Get-WmiObject -Namespace root\wmi -Class BcdObject |
    Where-Object { $_.Type -eq 0x10200003 }

Output:

yaml
__GENUS                : 2
__CLASS                : BcdObject
Id                     : {12345678-...}
StoreFilePath          : \Device\HarddiskVolume1\EFI\Microsoft\Boot\BCD
Type                   : 271646723

The community module BCDModule and similar projects wrap parts of this — but for one-off changes, bcdedit remains the simplest path. For image editing where you also need partition manipulation, pair bcdedit /store with Mount-DiskImage (PowerShell, see dism for related image-servicing flows).

Recovery scenarios

Unbootable Windows after a bad bcdedit change

If a bcdedit change leaves the system unbootable:

  1. Boot from a Windows installation USB (any version matching the build, give or take).
  2. Choose "Repair your computer" → Troubleshoot → Advanced options → Command Prompt.
  3. Find the system partition with diskpart (usually a small FAT32 partition labelled "System").
  4. Re-run bcdedit /store <SystemDrive>:\EFI\Microsoft\Boot\BCD /import <BackupFile> or fix the offending element with /set / /deletevalue on the offline store.
cmd
rem Find the right partition in WinRE
diskpart
DISKPART> list disk
DISKPART> select disk 0
DISKPART> list partition
DISKPART> select partition 1
DISKPART> assign letter=S
DISKPART> exit

rem Restore from backup
bcdedit /store S:\EFI\Microsoft\Boot\BCD /import C:\BCDBackup\bcd_MYHOST_20260524.bcd

Output:

code
The operation completed successfully.

Missing boot menu — only the default OS boots

Caused by a timeout of 0 or a corrupted displayorder. Reset both:

cmd
bcdedit /timeout 10
bcdedit /displayorder {default} /addfirst

Output:

code
The operation completed successfully.
The operation completed successfully.

Rebuild the BCD store from scratch

If the BCD is so corrupt that bcdedit /enum won't even list entries, blow it away and let bcdboot rebuild from the Windows install on disk.

cmd
rem In WinRE
attrib -s -h S:\EFI\Microsoft\Boot\BCD
ren S:\EFI\Microsoft\Boot\BCD BCD.old
bcdboot C:\Windows /s S: /f UEFI

Output:

code
Boot files successfully created.

Switch from legacy BIOS to UEFI boot post-install

mbr2gpt.exe (Windows 10 1703+) converts the disk in place; then bcdboot writes UEFI boot files.

cmd
rem Convert MBR → GPT on disk 0
mbr2gpt /convert /disk:0 /allowFullOS
bcdboot C:\Windows /f UEFI

Output:

vbnet
MBR2GPT: Validating layout, disk sector size: 512 bytes
MBR2GPT: Disk layout validation successful.
MBR2GPT: Creating the EFI system partition
MBR2GPT: Installing the new boot files
MBR2GPT: Performing the layout conversion
MBR2GPT: Migrating GPT entries
MBR2GPT: Conversion completed successfully
Boot files successfully created.

(Change firmware setting from CSM/Legacy to UEFI on next boot.)

Boot menu policy: legacy F8 vs Standard

Pre-Windows 8 systems used the "Legacy" boot menu — the text-mode menu you got by tapping F8 during POST. Windows 8 and later default to "Standard" (touch-friendly, graphical). To restore the F8 menu for easier Safe Mode access:

cmd
bcdedit /set {current} bootmenupolicy Legacy

Output:

code
The operation completed successfully.

(Press F8 at startup to reach the classic menu.)

cmd
rem Revert to Standard
bcdedit /set {current} bootmenupolicy Standard

Output:

code
The operation completed successfully.

Memory testing — {memdiag}

The Windows Memory Diagnostic entry is a separate boot application (MdSched.exe) referenced by {memdiag}. It is shown in the tools menu and can be invoked on the next reboot.

cmd
rem Show the entry
bcdedit /enum {memdiag}

Output:

markdown
Windows Memory Tester
---------------------
identifier              {memdiag}
device                  partition=\Device\HarddiskVolume1
path                    \boot\memtest.exe
description             Windows Memory Diagnostic
locale                  en-US
inherit                 {globalsettings}
badmemoryaccess         Yes
cmd
rem Schedule a one-time memory test at next boot
bcdedit /bootsequence {memdiag}

Output:

code
The operation completed successfully.

Re-running the command after reboot is not needed — /bootsequence is a one-time override that clears itself after use.

Logging bcdedit operations

bcdedit does not produce its own log file. To audit who changed what, wrap calls in a logging cmd or PowerShell function that timestamps stdout and stderr.

cmd
@echo off
set LOG=C:\Logs\bcd_%COMPUTERNAME%_%DATE:~-4,4%%DATE:~-10,2%%DATE:~-7,2%.log
echo [%DATE% %TIME%] %~n0 invoked by %USERNAME% >> %LOG%
echo Command: bcdedit %* >> %LOG%
bcdedit %* >> %LOG% 2>&1
echo. >> %LOG%

Output (in log):

csharp
[Mon 05/25/2026 14:22:05.31] mybcd invoked by alicedev
Command: bcdedit /timeout 10
The operation completed successfully.
powershell
# PowerShell version with transcript
Start-Transcript -Path "C:\Logs\bcd_$(Get-Date -f yyyyMMdd).log" -Append
bcdedit /timeout 10
Stop-Transcript

Output: (no direct output; everything captured in transcript)

Cross-references with dism and image editing

When customising an offline Windows image, bcdedit and dism are often paired: dism modifies the OS image (features, drivers, packages) and bcdedit adjusts its boot entries. See dism — Deployment Image Servicing and Management for the full image-servicing workflow. The typical sequence for preparing a deployable image:

  1. Mount-DiskImage on a VHDX containing a sysprepped Windows install.
  2. dism /Image:<MountDir> to enable features / inject drivers.
  3. bcdedit /store <MountDir>\Boot\BCD to set the default and timeout.
  4. Dismount-DiskImage to release the VHDX.
  5. Deploy.
powershell
$vhd = Mount-DiskImage -ImagePath "D:\images\gold.vhdx" -PassThru
$os = ($vhd | Get-Disk | Get-Partition | Where-Object Type -eq 'Basic' | Get-Volume).DriveLetter

# Service the OS partition
dism /Image:"$os`:\" /Add-Driver /Driver:C:\Drivers\fleet /Recurse

# Adjust the boot store inside the image
bcdedit /store "$os`:\Boot\BCD" /timeout 5
bcdedit /store "$os`:\Boot\BCD" /default '{default}'

Dismount-DiskImage -ImagePath "D:\images\gold.vhdx"

Output: (each step prints success messages; final image ready for deployment)

Common pitfalls (continued)

  1. bcdedit requires elevation even to read/enum works for read-only, but PowerShell remoting often loses elevation; use Start-Process powershell -Verb RunAs to relaunch.
  2. /set hypervisorlaunchtype off does not uninstall Hyper-V — it only disables the hypervisor at boot; uninstall the Windows feature with dism /Disable-Feature for permanent removal.
  3. testsigning on requires Secure Boot off — the flag is set but silently ignored when Secure Boot is enabled; check with Confirm-SecureBootUEFI first.
  4. {current}{default} after F8 menu pick — if the user picked a non-default OS, {current} refers to the booted one, not the default. Scripts should pick explicitly.
  5. bcdedit /timeout 0 plus single entry hides the menu — even with multiple entries, timeout 0 boots the default immediately; set ≥ 1 to keep the menu visible.
  6. No PowerShell cmdlet wrapper exists — automation requires either text-parsing bcdedit output or WMI; there is no Get-BcdEntry cmdlet in stock Windows.
  7. BCD on dual-boot systems with non-Windows OSes — Linux GRUB and macOS rEFInd do not modify the Windows BCD; if Windows is the boot manager, those OSes need a BCD entry pointing to their loader (bootsector element with device=...).
  8. VHD-boot child BCDs are independent — the BCD inside the VHD is separate from the host's BCD; both must be coherent for the inner OS to boot.

Real-world recipes (continued)

Pre-flight backup wrapper

A reusable wrapper that exports the BCD before any change.

cmd
@echo off
setlocal
set BACKUP_DIR=C:\BCDBackup
md %BACKUP_DIR% 2>nul
set STAMP=%DATE:~-4,4%%DATE:~-10,2%%DATE:~-7,2%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
set STAMP=%STAMP: =0%
set BACKUP=%BACKUP_DIR%\bcd_%COMPUTERNAME%_%STAMP%.bcd
bcdedit /export "%BACKUP%"
echo Backup: %BACKUP%
echo Now running: bcdedit %*
bcdedit %*
endlocal

Output:

yaml
The operation completed successfully.
Backup: C:\BCDBackup\bcd_MYHOST_20260525_142205.bcd
Now running: bcdedit /timeout 10
The operation completed successfully.

Multi-host BCD timeout audit

Use psexec or Invoke-Command to collect boot timeouts from every host on the network.

powershell
$hosts = "host1","host2","host3"
$hosts | ForEach-Object {
    $h = $_
    Invoke-Command -ComputerName $h -ScriptBlock {
        $out = bcdedit /enum '{bootmgr}' 2>&1
        ($out | Select-String -Pattern "^timeout\s+(\d+)").Matches.Groups[1].Value
    } | Select-Object @{N='Host';E={$h}}, @{N='Timeout';E={$_}}
}

Output:

diff
Host    Timeout
----    -------
host1   30
host2   30
host3   5

Schedule a one-time Safe Mode + auto-revert via Task Scheduler

A common admin pattern: boot once into Safe Mode to run a cleanup, then automatically revert and reboot back to normal.

cmd
rem Step 1: schedule the revert task to run after next boot
schtasks /Create /TN "RevertSafeBoot" /SC ONSTART /TR "cmd /c bcdedit /deletevalue {current} safeboot & shutdown /r /t 30 & schtasks /Delete /TN RevertSafeBoot /F" /RL HIGHEST /F

rem Step 2: flip safeboot and reboot
bcdedit /set {current} safeboot minimal
shutdown /r /t 5

Output:

vbnet
SUCCESS: The scheduled task "RevertSafeBoot" has successfully been created.
The operation completed successfully.

After the next boot completes the cleanup and reboots once more, the scheduled task removes the safeboot flag and reboots into normal mode.

Add a Windows-to-Go entry

bcdedit can create an entry that boots from a removable USB device.

cmd
for /F "tokens=2 delims={}" %%G in ('bcdedit /copy {current} /d "Windows To Go (USB)" ^| findstr "successfully copied"') do set NEWID={%%G}
bcdedit /set %NEWID% device partition=E:
bcdedit /set %NEWID% osdevice partition=E:
bcdedit /set %NEWID% description "Windows To Go (USB drive)"
bcdedit /displayorder %NEWID% /addlast

Output (each):

code
The operation completed successfully.

Sources

Microsoft Learn — bcdedit command — Overview of BCDEdit and the store/entry/element/output/boot-manager/EMS/debug parameter groups.

Microsoft Learn — BCDEdit /set (driver dev test) — Authoritative catalog of bcdedit /set data types covering boot settings, HAL/kernel overrides, verification (testsigning, nointegritychecks), processor/memory tuning, debugger and hypervisor settings, and Virtual Secure Mode (vsmlaunchtype).

See also