Modify the BCD Store Template

A BCD store template is available with Windows Vista and Windows Server 2008 that you can use to create a custom store for imaging needs. The template store is located in the %WINDIR%\System32\Config folder and is named BCD-template. BCD-template includes all the objects and elements that are already created, including inherit settings objects which are used for debugsettings and loadersettings. The BCD-template has specific values that are unique to Windows Vista and Windows Server 2008.

There are two ways you can use the BCD-template to create a custom BCD store: First, copy BCD-template to a temporary file, for example, Tempbcd.

  • You can specify the store file name on each bcdedit command. For example,

    bcdedit /store tempbcd /enum all
    
  • Use the following command to import tempbcd into the system store:

    bcdedit /import tempbcd
    

    After making your changes, export the system BCD store to save your custom template to a file. Export the system store into a new BCD store using the following command:

    bcdedit /export newbcd
    

    All changes made to the system BCD store are now saved in a backup store, Newbcd. The Newbcd store can be imported on other machines that have identical BCD configurations.

  • Alternatively, you can specify the store file name on each bcdedit command, for example:

    bcdedit /store tempbcd /enum all 
    

All changes to the separate store, Tempbcd, are not active until you import the file to the system store.

In the following examples, Tempbcd is assumed to have been imported to the system store. After making these changes, export the system store to a separate file.

The changes to BCD settings for EFI-based systems require the following objects to be updated:

  • The Windows Boot Manager
  • The Windows Boot Loader
  • The Windows Memory Diagnostics

Each of these changes are described in the following sections.

Boot Manager Settings

The Windows Boot Manager device and path settings under the identifier {bootmgr}, must point to the correct partition and executable. In the BCD-template for Windows Vista, these settings are as follows:

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=C:
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager

In the BCD-template for Windows Server 2008, these settings are as follows:

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume1
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager

For EFI systems, confirm the value or set path to \EFI\Microsoft\Boot\Bootmgfw.efi. For example,

Bcdedit /set {bootmgr} path \efi\microsoft\boot\bootmgfw.efi

The Boot Manager device must be set to the EFI System Partition (ESP) volume letter. Use the diskpart command to view the disk partitions. The following example assumes the computer has a single disk with multiple partitions. The following example shows how to select disk 0, and list the details of the volumes on that disk, including the drive letter. If the drive letter is not assigned to the ESP partition, use the assign command to assign a volume letter to the ESP.

Diskpart
DISKPART> select disk 0
DISKPART> list volume

In this example, the U: volume is the ESP system volume.

DISKPART> list volume
  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  ------
  Volume 0     D                NTFS   Partition    103 GB  Healthy
  Volume 1     C                NTFS   Partition     49 GB  Healthy    Boot
  Volume 2     U                FAT32  Partition   2000 MB  Healthy    System

If the ESP partition does not have a volume letter assigned, use the diskpart assign command to specify a drive letter.

DISKPART> select disk 0
DISKPART> select volume 2
Diskpart > assign letter=U

For EFI-based computers, set the device to the drive letter for the EFI System Partition (ESP).

Bcdedit /set {bootmgr} device partition=U:        // ESP partition

You can configure the Windows Boot Manager to be the first item in the EFI firmware boot menu list. The following command configures the Windows Boot manager as the first item in the firmware display order list.

Bcdedit /set {fwbootmgr} displayorder {bootmgr} /addfirst
Bcdedit /set {bootmgr} displayorder { <ID GUID for Windows Boot Loader>} /addfirst

The GUID identifier for displayorder will be the identifier for the Windows Boot Loader object described in the next section.

Boot Loader Settings

A BCD store has at least one Windows Boot Loader object, but can have several. The Windows Boot Loader device and path settings under a unique GUID identifier must point to the correct partition and executable. The default boot loader object has the alias {default}. In the BCD-template for Windows Vista, these settings are as follows:

Windows Boot Loader
-------------------
identifier              {8bfa4708-e6de-11db-be69-00111197b8f6}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Microsoft Windows Vista
locale                  en-US
inherit                 {bootloadersettings}
osdevice                partition=C:
systemroot              \Windows

In the BCD-template for Windows Server 2008, these settings are as follows:

Windows Boot Loader
-------------------
identifier              {9f25ee7a-e7b7-11db-94b5-f7e662935912}
device                  partition=C:
path                    \Windows\system32\winload.efi
description             Windows Server 2008
locale                  en-US
inherit                 {bootloadersettings}
osdevice                partition=C:
systemroot              \Windows

For EFI-based computers, confirm or set the value of the path to the Windows Boot Loader for EFI: \Windows\System32\Winload.efi. The value of <ID_GUID> is the identifier for the Windows Boot Loader object. You can use the identifier from the template ({9f25ee7a-e7b7-11db-94b5-f7e662935912}), or you can create a new GUID, depending on how you image the system.

Bcdedit /set {<ID GUID>} path \windows\system32\winload.efi

The Boot Loader device and osdevice settings must point to the correct drive letter for the operating system partition. The operating system device letter is usually C:\.

Bcdedit /set {<ID GUID>} device partition=C:        // Active partition
Bcdedit /set {<ID GUID>} osdevice partition=C:

Set the default Windows boot loader object with the identifier used for boot loader object.

Bcdedit /default  {<ID GUID>}

Memory Diagnostics Settings

The Windows Memory Tester device and path settings under the identifier {memdiag}, must point to the correct partition and executable. In the BCD-template for Windows Vista, these settings are as follows:

Windows Memory Tester
---------------------
identifier              {memdiag}
device                  partition=C:
path                    \boot\memtest.exe
description             Windows Memory Diagnostic

In the BCD-template for Windows Server 2008, these settings are as follows:

Windows Memory Tester
---------------------
identifier              {memdiag}
device                  partition=\Device\HarddiskVolume1
path                    \boot\memtest.exe
description             Windows Memory Diagnostic

For EFI systems, set the device to the drive letter of the EFI system partition.

Bcdedit /set {bootmgr} device partition=U:        // ESP partition

For EFI systems, you must also confirm or set the value of the path to the Windows Memory Diagnostic for EFI (\Efi\Microsoft\Boot\Memtest.efi).

Bcdedit /set {memdiag} path \efi\microsoft\boot\memtest.efi

BIOS Settings

For BIOS-based computers, the BCD setting changes described above are summarized in the following sections.

Boot Manager

For BIOS-based computers, the path and device settings are different. The BIOS path is \bootmgr.exe or no value. The BIOS boot manager device is the active partition. For example,

Bcdedit /deletevalue {bootmgr} path
Bcdedit /set {bootmgr} device partition=C:        // Active partition

Boot Loader

For BIOS-based computers, the path to the Windows Boot Loader is \windows\system32\winload.exe. For example,

Bcdedit /set {<ID GUID>} path \windows\system32\winload.exe

The Boot Loader device and osdevice settings must point to the correct drive letter for the operating system partition. The operating system device letter is typically, C:\. For example,

Bcdedit /set {<ID GUID>} device partition=C:        // Active partition
Bcdedit /set {<ID GUID>} osdevice partition=C:

where <ID GUID> is the GUID of the boot loader object.

Memory Diagnostics

For BIOS-based computers, confirm or set device to the active partition, and the path to \Boot\Memtest.exe.

Bcdedit /set {bootmgr} device partition=C:        // Active partition
Bcdedit /set {memdiag} path \boot\memtest.exe