Programming4us
         
 
 
Windows Server

Windows Server 2008 Server Core : Managing the Boot Configuration with the BCDEdit Command

- Windows Server 2008 R2 : Work with RAID Volumes - Understand RAID Levels & Implement RAID
- Windows Server 2008 R2 Administration : Managing Printers with the Print Management Console
- Configuring Email Settings in Windows Small Business Server 2011
- Windows Server 2008 R2 : Configuring Folder Security, Access, and Replication - Implement Permissions
7/17/2011 11:30:17 AM
The Boot Configuration Data Store Editor (BCDEdit) command is a powerful replacement for the BootCfg utility provided with previous versions of Windows. The main reason for the replacement is that Microsoft has significantly changed the boot cycle to accommodate new technologies such as BitLocker. The BCDEdit utility relies on commands, as do many utilities in Windows, but you access the commands from the command line, rather than using an interactive environment as you would when working with other utilities such as Telnet. You specify one or more commands in sequence to obtain specific results from BCDEdit. Consequently, this utility doesn't use a precise command line syntax, nor do the commands appear in any specific order. Here are the commands that you can use with their associated options.

/bootdebug
[ID]
{On | Off}

Turns boot debugging on or off. When you specify an identifier, the switch affects the specified application. You can use this command on any entry, but it only affects boot applications. If you specify this command without an identifier, the system sets boot debugging for the operating system loader.

NOTE

You can obtain a list of common identifiers by typing BCDEdit/?ID at the command line. The resulting list shows the common identifiers that could appear in the boot configuration, not those that actually do appear. Use the BCDEdit/enum command to display the identifiers that do appear as part of the configuration.


/bootems
[ID]
{On | Off}

Turns on or off Emergency Management Services (EMS) for the specified entry. When you specify an identifier, the switch affects the specified application. You can use this command on any entry, but it only affects boot applications. If you specify this command without an identifier, the system sets EMS for the operating system loader.


/bootsequence
ID
[...] [ {/addfirst | /addlast | /remove}]

Modifies the boot sequence. Use a single identifier with the /addfirst and /addlast options to add an identifier to the beginning or end of the boot sequence. Use the /remove option to remove the identifiers from the boot sequence.


[/store
Filename] /copy ID /d Description

Copies the specified identifier. The /d option specifies the description that you want assigned to the copy of the identifier. You may optionally store the copy in a different file using the /store option, which must appear in front of the /copy command.


/create
[ID] /d Description [{/application AppType | /inherit [AppType]
| /inherit DEVICE | /device}]

Creates a new identifier. You can optionally specify an identifier for the new entry. The /d option provides a description of the new entry. The /application option creates a new application entry of one of the following types: BOOTSECTOR, OSLOADER, RESUME, or STARTUP. The /inherit option creates an inherit entry, one that's inherited by other entries. If you don't specify an application type, then any application can inherit the entry. The allowable inherit entry types include BOOTMGR, BOOTSECTOR, FWBOOTMGR, MEMDIAG, NTLDR, OSLOADER, and RESUME. The /inherit DEVICE option creates a special inherit entry that's only inherited by device options. The /device option creates a new device options entry.

NOTE

The type information associated with the data store defines the format of the entry and how it affects the boot process. For example, an OSLOADER entry lets you load other operating systems. These options appear as part of the boot menu. Use the BCDEdit /? TYPES command to display a complete list of entry types. Add the type name to the command line and you'll see specific help for that type.


/createstore
Filename

Creates a new file that contains a boot configuration data store.


/dbgsettings
[DebugType [DEBUGPORT:<port>] [BAUDRATE:BAUD] [CHANNEL:Channel] [TARGETNAME:TargetName] /start StartPolicy
/noemux ]

Changes the debugger settings. Don't confuse this setting with /bootdebug, which chooses the items to debug. This setting affects the specified debugger type: SERIAL, 1394, or USB. Use the DEBUGPORT and BAUDRATE settings for serial port debugging, the CHANNEL setting for 1394 debugging, and the TARGETNAME setting for USB debugging. The /start option defines how the device starts and you can use these settings: ACTIVE, AUTOENABLE, or DISABLE. The /noemux option tells the kernel mode debugger to ignore any user-mode exceptions.


/debug
[ID]
{On | Off}

Turns on or off kernel mode debugging. When you specify an identifier, the switch affects the specified Windows boot loader. You can use this command on any entry, but it only affects Windows boot loader entries. If you specify this command without an identifier, the system sets kernel mode debugging for the current boot loader.


/default
ID

Specifies the entry to use as the default boot manager. When the timer runs out, the system automatically boots the selected entry.


[/store
Filename] /delete ID
[/f] [/cleanup | /nocleanup]

Deletes the specified entry from the data store. Use the /f option to ensure BCDEdit deletes the entry; otherwise, it won't delete well-known entries. The /cleanup option ensures that the deleted item is removed from the display order. This option also removes any entries that reference the deleted entry. The /cleanup option is the default—you must specify /nocleanup when you don't want the deleted entry removed from the display order. You may optionally delete entries in a different file using the /store option, which must appear in front of the /delete command.


[/store
Filename] /deletevalue [ID] DataType

Deletes a data element from an entry in the boot configuration. The data type corresponds to one of the standard types you obtain using the BCDEdit /? TYPES command. When you specify an identifier, the switch affects the specified entry. If you specify this command without an identifier, the system deletes an entry for the current boot loader. You may optionally delete entries in a different file using the /store option, which must appear in front of the /deletevalue command.


/displayorder
ID
[...] [ {/addfirst | /addlast | /remove}]

Modifies the entry display order. Use a single identifier with the /addfirst and /addlast options to add an identifier to the beginning or end of the display order. Use the /remove option to remove the identifiers from the display order.


/ems
[ID]
{On | Off}

Turns on or off Emergency Management Services (EMS) for the specified boot entry. When you specify an identifier, the switch affects the specified boot entry. You can use this command on any entry, but it only affects boot entries. If you specify this command without an identifier, the system sets EMS for the current boot entry.


/emssettings {BIOS | EMSPORT:
Port EMSBAUDRATE:BAUDRate}

Defines the global EMS settings. This command doesn't enable or disable EMS for any particular boot entry—it simply defines how EMS communicates. The BIOS option lets EMS rely on the BIOS configuration to determine how to react. This setting only works when your BIOS provides EMS support. The EMSPORT and EMSBAUDRATE settings affect serial port support and you shouldn't use them with the BIOS option.


[/store
Filename] /enum [{EntryType | ID
}] [/v]

Lists the contents of the data store. The /enum command can list all of the entries, a specific entry, or entries of a particular type. The types you can list include ACTIVE, FIRMWARE, BOOTAPP, BOOTMGR, OSLOADER, RESUME, INHERIT, and ALL. The /v option displays the entry GUIDs, rather than the well-known values. You may optionally list entries in a different file using the /store option, which must appear in front of the /enum command (see Figure 1).


/export
Filename

Exports the system's data store to an external file. This is an essential part of any work you do with the boot configuration. Always export the current boot configuration to a file so that you can restore it if your changes don't work. To export the book configuration, type BCDEdit /Export C:\ThisConfig.TXT and press Enter. If you later find that the changes you made don't work, you can use the /Import command line switch to import the old file. It's important to remember that you can boot the distribution media and open a command prompt to execute this command, so it's possible to recover from bad boot configurations, even if the server won't boot properly.


/import
Filename

Imports the entries found in an external file into the system data store. You must use the \Export command line switch to create an external data store before you can use this file. To import a data store that you created previously, type BCDEdit /Import C:\ThisConfig.TXT and press Enter.

Figure 1. The /enum command outputs the contents of the current data store.

[/store
Filename] /set [ID] DataType Value

Changes the value of an entry to a new value. When you specify an identifier, the command affects the specified entry. If you specify this command without an identifier, the system sets values for the current boot entry. You may optionally change entries in a different file using the /store option, which must appear in front of the /set command.

The /set command is the one that you'll use most often because it lets you make changes. The easiest and safest way to use this command is to create an enumeration of the current data store by typing BCDEdit /Enum and pressing Enter (see Figure 16.1 for typical output). Once you know the specifics of the data store, you can set values. For example, if you want to set the Description property for the Windows Legacy OS Loader entry shown in Figure 16.1, you might type BCDEdit /Set {ntldr} Description "Windows 2003 Server - 64 Bit" and press Enter. Notice that you provide an identifier for the boot partition, {ntldr}. The name of the property is Description. The value for that property is "Windows 2003 Server - 64 Bit". You must encase any properties that contain spaces in quotes. Whenever you make a change, always verify it by typing BCDEdit /Enum and pressing Enter. Make only one change at a time and verify each change.


/store
[Filename]

Defines the data store to which other commands in the stream apply. You can't use this command with the /createstore command. If you don't include a filename, the commands affect the system store.


/timeout
Timeout

Changes the time that the boot manager waits for the user to make a selection before booting the default entry. The default setting is 30 seconds.


/toolsdisplayorder
ID
[...] [ {/addfirst | /addlast | /remove}]

Modifies the tools display order when displaying the tools menu during the boot sequence. Use a single identifier with the /addfirst and /addlast options to add an identifier to the beginning or end of the tools display order. Use the /remove option to remove the identifiers from the tools display order.

Now that you have a better idea of the commands you can use with BCDEdit, it's time to look at what passes for command line syntax. This utility uses the following syntax:

BCDEdit <Command> [<Command>...] [/? [TOPICS] [ID] [TYPES [{BOOTAPP |
BOOTMGR | BOOTSECTOR | CUSTOMTYPES | FWBOOTMGR | MEMDIAG | NTLDR |
OSLOADER | RESUME}]] [FORMATS]] [/enum] [/v]

The following list describes each of the command line arguments.


/?

Obtains help about the specific command.


TOPICS

Displays a list of detailed help topics, which includes the commands, standard identifiers, data types, and other command line options.


ID

Displays a list of well-known identifiers for the operating system. For example, the {bootmgr} entry refers to the Windows Boot Manager entry.


TYPES [{BOOTAPP | BOOTMGR | BOOTSECTOR | CUSTOMTYPES | FWBOOTMGR | MEMDIAG | NTLDR | OSLOADER | RESUME}]

Displays help information about configuration entry types. Using TYPES alone displays a list of the available types. Using TYPES with a specific entry, such as TYPES BOOTAPP, displays the type information for that entry.


FORMATS

Displays information about the type information formatting rules.


/enum

Lists the entries in a store.


/v

Displays verbose information for the specified command. The amount of additional information varies by command.

Other -----------------
- Windows Server 2008 : Enabling and Testing Event Subscriptions
- Windows Server 2008 : Adding an Account to the Event Log Readers Group
- Windows Server 2008 : Enabling the Source Computer with winrm & Enabling the Collector Computer with wecutil
- Windows Server 2008 : Using Virtualization to Increase Productivity and Facilitate Consolidation
- Windows Server 2008 : Using Virtualization to Increase Productivity and Facilitate Consolidation - Installing Hyper-V
- Windows Server 2008 : Using Virtualization to Increase Productivity and Facilitate Consolidation - Introducing Virtualization & Server Consolidation
- Windows Server 2003 : Configuring IAS for Use with VLANs
- Windows Server 2003 : Configuring IAS for Use with VLANs
- Windows Server 2003 : Using IAS to Protect the Network from Bad Computers
- Windows Server 2003 : Centralizing Authentication and Authorization with Internet Authentication Server - Configuring IAS as a RADIUS Proxy
- Windows Server 2003 : Centralizing Authentication and Authorization with Internet Authentication Server - Installing and Configuring IAS
- Windows Server 2003 : Centralizing Authentication and Authorization with Internet Authentication Server - The RADIUS Protocol
- Windows Server 2008 R2 : Optimizing Performance by Server Roles
- Windows Server 2008 : Monitoring System Performance (part 2)
- Windows Server 2008 : Monitoring System Performance (part 1) - Key Elements to Monitor for Bottlenecks
- Windows Server 2008 : Using Capacity-Analysis Tools (part 4) - Other Microsoft Assessment and Planning Tools
- Windows Server 2008 : Using Capacity-Analysis Tools (part 3) - Windows Performance Monitor
- Windows Server 2008: Using Capacity-Analysis Tools (part 2) - Network Monitor
- Windows Server 2008: Using Capacity-Analysis Tools (part 1) - Task Manager
- Windows Server 2008: Defining Capacity Analysis
 
 
Most View
- Parallel Programming with Microsoft .Net : Dynamic Task Parallelism - Variations
- Windows Server 2008 : Recovering Role Services and Features (part 3)
- SharePoint 2010 : Managing Security - See What Permissions Are Set (part 2)
- Windows 7 : Maintaining Your Privacy While Reading Email
- Windows 7 : Configuring a Peer-to-Peer Network (part 1) - Configuring the TCP/IP Protocol
- User-Level Security : Authorization and Impersonation (part 3) - Security Token Authentication
- Microsoft XNA Game Studio 3.0 : Adding Bread to Your Game (part 2) - Improving Programs Using Methods, Handling Collisions
- Windows Server : Configuring TS RemoteApp
- Monitoring SQL Server 2005 Performance : Using Windows System Monitor & Using SQL Server Profiler
- Windows Server 2008 : Installing the Web Server Role (part 8)
Top 10
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 3) - Configuring Recipient Filtering
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 2)
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 1)
- Implementing Edge Services for an Exchange Server 2007 Environment : Installing and Configuring the Edge Transport Server Components
- What's New in SharePoint 2013 (part 7) - BCS
- What's New in SharePoint 2013 (part 6) - SEARCH
- What's New in SharePoint 2013 (part 6) - WEB CONTENT MANAGEMENT
- What's New in SharePoint 2013 (part 5) - ENTERPRISE CONTENT MANAGEMENT
- What's New in SharePoint 2013 (part 4) - WORKFLOWS
- What's New in SharePoint 2013 (part 3) - REMOTE EVENTS