Change BCD path in Legacy and UEFI mode

Have a user asked me how to change the BCD path. In this article I will guide you to do it on both Legacy and UEFI modes.

Boot Configuration Data (BCD) files provide a store that is used to describe boot applications and boot application settings. The objects and elements in the store effectively replace Boot.ini. See more about BCD.

Legacy

The default path of the BCD file in Legacy BIOS mode is /boot/bcd. AIO Boot using BCD path in Legacy mode is /AIO/Menu/WinLegacy. The purpose I do it is to remove the /boot directory and use the /AIO directory instead.

In Legacy mode, we need to modify the bootmgr file to change the BCD path. The simplest way is to use the BMplus software to create the bootmgr and bootmgr.exe files. With this software, you can also change the path for boot.ini and the font directory. It also supports a list of interfaces and of course you can also edit these interfaces.

BMplus - change BCD path for bootmgr

After setting the paths and options, click the Make BOOTMGR button to create the bootmgr file. This file is located in the BM.Builds directory. You only need the file bootmgr70, bootmgr81 or bootmgr10.

UEFI

In UEFI mode, the default BCD path is /EFI/Microsoft/Boot/BCD. I use the name BCD for 64-bit and B86 for 32-bit, this gives me two separate menu files. In this mode, 32-bit versions of Windows can not boot on 64-bit UEFI and 64-bit versions of Windows can not boot on 32-bit UEFI. I use two separate BCD files to make sure all menus work.

We will edit the bootx64.efi file for 64-bit and bootia32.efi for 32-bit. Note: Secure Boot will not work with the modified files. I will use HxD to edit the hex code of these files. You can use any Hex editor you want. Open bootx64.efi with HxD, press Ctrl + F to open the find box and enter the following:

Change BCD path for bootx64.efi

  • Search for42 00 43 00 44
  • Datatype: Hex-values

I found the following results:

change BCD path for bootia32.efi

Ok now I will edit the BCD file name to another name. Each character is separated by a null character (Hex code is 00). We must leave at least the last 3 characters. The maximum length of bootx64.efi is 6 characters, bootia32.efi is 4 characters.

For example, I want to change the BCD name to BCDx64, I will edit it as follows:

5C 00 42 00 43 00 44 00 78 00 36 00 34

edit file bootmgr

The last step is to save this file and test it. Do not forget to rename your BCD file. Repeat the above steps to change the BCD path for the bootia32.efi file.

Grub2

To boot the above files from Grub2, add the following menu to the Grub2 configuration file:

menuentry "WinPE & Setup" {
	if [ "${grub_platform}" == "efi" ]; then
		if [ "${grub_cpu}" == "x86_64" ]; then
			chainloader /bootx64.efi
		else
			chainloader /bootia32.efi
		fi
	else
		ntldr /bootmgr
	fi
}

AIO Boot menu file is /AIO/Menu/Main.cfg. You need to change the path and name of the files.

Grub4dos only supports Legacy mode:

title WinPE & Setup
chainloader /bootmgr
Share this...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInPin on PinterestShare on RedditShare on TumblrShare on VKBuffer this pageDigg thisEmail this to someoneFlattr the authorPrint this pageShare on StumbleUponShare on Yummly