Partager via


BCDboot Command-Line Options

Applies To: Windows 7

Note

This content applies to Windows 7. For Windows 8 content, see Windows Deployment with the Windows ADK.

The BCDboot tool is a command-line tool that enables you to manage system partition files. You can use the tool in the following scenarios:

  • Setting up a system partition when you deploy new computers. For more information, see Capture and Apply Windows Images.

  • Setting up Windows® to boot to a virtual hard disk. For instructions, see Walkthrough: Deploy a Virtual Hard Disk for Native Boot.

  • Repairing the boot environment located on the system partition. If the system partition has been corrupted, you can use BCDboot to replace the system partition files with new copies of these files from the Windows partition.

    For example, if you have set up an additional hard drive or partitions by using Windows® 7, and your Windows Vista® no longer appears in your boot menu, you can use the bcdboot D:\Windows command to restore the Windows Vista® boot entry, where D is the drive letter of your Windows Vista® partition.

How It Works

To configure the system partition, BCDboot copies a small set of boot-environment files from the installed Windows image to the system partition. Next, BCDboot creates a Boot Configuration Data (BCD) store on the system partition that instructs the computer to boot to the Windows partition.

BCDboot can copy boot environment files from images of Windows 7, Windows Vista, Windows Server® 2008 R2, or Windows Server® 2008.

BCDboot uses the %WINDIR%\System32\Config\BCD-Template file to create a new BCD store and initialize the BCD boot-environment files on the system partition. You can define specific BCD settings in the BCD-Template file. The BCDboot tool also copies the most recent versions of boot-environment files from the operating-system image %WINDIR%\boot folder to the system partition.

BCDboot can update an existing boot environment on the system partition:

  • BCDboot copies newer versions of files from the Windows image to the system partition.

  • If a BCD store already exists on the system partition, BCDboot creates a new boot entry in the existing BCD store based on settings in the BCD-Template file.

  • If there is already a boot entry for this Windows partition, by default, BCDboot erases the old boot entry and its values. To retain the values from an existing boot entry when you update the system files, you can use the /m option together with the BDCBoot.exe command.

Command-Line Options

The following command-line options are available for BCDboot.exe.

BCDBOOT <source> [/l <locale>] [/s <volume-letter> [/v] [/m [{OS Loader GUID}]]

Option Description

<source>

Required. Specifies the location of the Windows directory to use as the source for copying boot-environment files.

The following example initializes the system partition by using BCD files from the C:\Windows folder:

bcdboot C:\Windows

/l <locale>

Optional. Specifies the locale. The default is US English (en-us).

The following example sets the default BCD locale to Japanese:

bcdboot C:\Windows /l ja-jp

/s <volume letter>

Optional. Specifies the volume letter of the system partition. This option should not be used in typical deployment scenarios.

Use this setting to specify a system partition when you are configuring a drive that will be booted on another computer, such as a USB flash drive or a secondary hard drive.

UEFI:

  • BCDBoot copies the boot files to either the EFI system partition, or the partition specified by the /s option.

    BCDBoot creates the BCD store in the same partition.

    By default, BCDboot creates a Windows Boot Manager entry in the NVRAM on the firmware to identify the boot files on the system partition. If the /s option is used, then this entry is not created. Instead, BCDboot relies on the default firmware settings to identify the boot files on the system partition. By the UEFI 2.3.1 spec, the default firmware settings should open the file: \efi\boot\bootx64.efi in the EFI System Partition (ESP).

BIOS:

  1. BCDBoot copies the boot files to either the active partition on the primary hard drive, or the partition specified by the /s option.

  2. BCDBoot creates the BCD store in the same partition.

The following example copies BCD files from the C:\Windows folder to a system partition on a secondary hard drive that will be booted on another computer. The system partition on the secondary drive was assigned the volume letter S:

bcdboot C:\Windows /s S:

The following example creates boot entries on a USB flash drive with the volume letter F, including boot files to support either a UEFI-based or a BIOS-based computer:

bcdboot C:\Windows /s F: /f ALL

/v

Optional. Enables verbose mode. Example:

bcdboot C:\Windows /v

/m [{OS Loader GUID}]

Optional. Merges the values from an existing boot entry into a new boot entry.

By default, this option merges only global objects. If you specify an OS Loader GUID, this option merges the loader object in the system template to produce a bootable entry.

The following example merges the operating-system loader in the current BCD store that the specified GUID identifies in the new BCD store:

bcdboot c:\Windows /m {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

Troubleshooting

For more information about repairing a computer that includes multiple hard drives or partitions, including both Windows XP and another operating system that BCDBoot supports (such as Windows® 8, Windows® 7, Windows Vista®, Windows Server® 2012, Windows Server® 2008 R2 or Windows Server® 2008), see https://support.microsoft.com/kb/2277998.

See Also

Concepts

Apply Images by Using ImageX

Other Resources

BCDedit