Windows/bcdedit

From Omnia
Revision as of 16:21, 22 July 2022 by Kenneth (talk | contribs) (→‎keywords)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

bcdedit - boot menu editor

Use the bcdedit program to edit the boot menu:

bcdedit.exe
;Warning: Boot.ini is used on Windows XP and earlier operating systems.
;Warning: Use BCDEDIT.exe to modify Windows Vista boot options.

This is a command line tool which is difficult to use.


bcdedit displays the boot items in the order they appear.

default boot

Update default boot menu item:

bcdedit /default {ntldr}    # boot to w2k3
bcdedit /default {current}  # boot to latest installed OS
bcdedit /default {1d3642e1-15b2-11df-a272-8144e7b5b488}  # boot to os specified by GUID

rename menu item

Rename item:

bcdedit /set {[ID]} description "[DESCRIPTION]"
bcdedit /set {ntldr} description "Windows Server 2003"    # boot to w2k3

timeout

You can use the System Properties -> Advanced -> 'Startup and Recovery' to change the default boot OS and timeout.

Update timeout

bcdedit /timeout 30

Really long timeout:

bcdedit /timeout 999999

Note: There is no option for unlimited timeout

command line options

C:\>bcdedit /?

BCDEDIT - Boot Configuration Data Store Editor

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.

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.

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.

Restore Point on Failure

Default is "Recovery"

bcdedit /set displaymessageoverride SystemRestore
displaymessageoverride:
0 = Default
1 = Resume
2 = HyperV
3 = Recovery
4 = StartupRepair
5 = SystemImageRecovery
6 = CommandPrompt
7 = SystemRestore
8 = PushButtonReset

Ref: https://www.geoffchappell.com/notes/windows/boot/bcd/elements.htm

Disable PCIExpress Features

Disable support for PCIe Hotplug:

bcdedit /set pciexpress ForceDisable

notes

D:\>bcdedit The boot configuration data store could not be opened. The system cannot find the file specified.

D:\>bcdedit /store d:\boot The boot configuration data store could not be opened. The system has attempted to load or restore a file into the registry, but the sp ecified file is not in a registry file format.

D:\>bcdedit /enum The boot configuration data store could not be opened. The system cannot find the file specified.

D:\>bcdedit /enum /store d:\Boot The boot configuration data store could not be opened. The system has attempted to load or restore a file into the registry, but the sp ecified file is not in a registry file format.

D:\>bcdedit /enum /store d:\Boot\BCD

Windows Boot Manager


D:\>bcdedit /timeout 30 /enum /store d:\Boot\BCD Invalid command line switch: /timeout Run "bcdedit /?" for command line assistance.

D:\>bcdedit /timeout 30 /store d:\Boot\BCD The operation completed successfully.


bcdedit /default {ntldr} /store d:\Boot\BCD


bootcfg?

bootcfg - Clone setting: [1]

bootcfg /copy /ID 2 /d "Microsoft Windows XP Professional - new"

create new config: [2]

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


Read: (for fix broken w2k8)

Enable Test Signing

bcdedit /set testsigning on

Disable Driver Integrity Checks

 bcdedit /set loadoptions DISABLE_INTEGRITY_CHECKS

Alt Disable integrity checks: (ref: [3])

# bcdedit.exe /set nointegritychecks on
# bcdedit.exe /set nointegritychecks true

keywords

See Windows_Server_2008