3

I want a BCD boot menu with multiple WinPE versions, that have their descriptions displayed. I made a thumb drive, and later PXE, that supports booting to multiple WinPE environments - from version 3.1 to 10, x64 and x32. Problem is that when creating BCD store to boot to PE, you have to use {ramdiskoptions} clause. In this case, upon booting, menu doesn't display "descriptions" from each entry - it displays description from {ramdiskoptions} entry only, so I ended up with multiple options named "Ramdisk Options". I will demonstrate how I did this (assume %STR% is full path to BCD store and %GUID% is explained below example):

1) bcdedit /createstore %STR%
2) bcdedit /store %STR% /create {ramdiskoptions} /d "Ramdisk Options"
3) bcdedit /store %STR% /set {ramdiskoptions} ramdisksdidevice Boot
4) bcdedit /store %STR% /set {ramdiskoptions} ramdisksdipath \Boot\boot.sdi
5) bcdedit /store %STR% /create /d "WinPE x86 3.1" /application osloader
6) bcdedit /store %STR% /set %GUID% systemroot \Windows
7) bcdedit /store %STR% /set %GUID% detecthal Yes
8) bcdedit /store %STR% /set %GUID% winpe Yes
9) bcdedit /store %STR% /set %GUID% osdevice ramdisk=[boot]\Boot\winpex86-31.wim,{ramdiskoptions}
10) bcdedit /store %STR% /set %GUID% device ramdisk=[boot]\Boot\winpex86-31.wim,{ramdiskoptions}
11) (repeat lines 5 to 10 as needed)
12) bcdedit /store %STR% /create {bootmgr} /d "Windows Boot Manager"
13) bcdedit /store %STR% /set {bootmgr} displayorder %GUID% ........

So I repeat lines 5 to 10 for WinPE v5 x86, v3.1 x64, v5 x64 and v10. Everytime I set new description at line 5, get new %GUID%, set appropriate image at line 9 and 10, finally I do displayorder with every %GUID% just created. Then I boot the drive, which says:

Ramdisk Options
Ramdisk Options
Ramdisk Options
Ramdisk Options
Ramdisk Options

I want it to show my descriptions from every entry, like WinPE x86 3.1. Please advise as to what might I be doing wrong. I also tried to use easy-bcd to modify entries, but I did not succeed.

EDIT

Fiddling some more, I've created another store and created only {ramdiskoptions} in there. I've issued two commands and here's their output (just displaying ID and type):

d:\!@>bcdedit /store %str% /enum all /V
Setup Ramdisk Options
---------------------
identifier              {ae5534e0-a924-466c-b836-758539a3ee3a}
d:\!@>bcdedit /store %str% /enum all
Setup Ramdisk Options
---------------------
identifier              {ramdiskoptions}

So I think, that all boils down to creating another entry of type "Setup Ramdisk Options", but I can't find proper command for that in bcdeditor's help. BTW Visual BCD craps out random errors about external programs modifying store and is useless.

ᄂ ᄀ
  • 4,187
Kitet
  • 2,077

3 Answers3

1

See this article. Basically, instead of having multiple entries under one ramdisk device, you can define multiple ramdisk devices.

Although only one {ramdiskoptions} object can be created it is possible to use a different .sdi file to the one specified in {ramdiskoptions} ramdisksdipath by using the following workaround. At present I have not found any real use for implementing this however, as cdob points out, it may be necessary in future.

bcdedit.exe /store C:\Boot\BCD /create /device

Running this first command will return a Globally Unique IDentifier (GUID) value - e.g. {e05b4c23-618a-11df-89c6-001d925a73cf}. In all subsequent commands replace {ramdisk_guid} with this value -

bcdedit.exe /store C:\Boot\BCD /set {ramdisk_guid} ramdisksdidevice partition=C:

bcdedit.exe /store C:\Boot\BCD /set {ramdisk_guid} ramdisksdipath \Boot\different.sdi

Now to use this to boot WinPE -

bcdedit.exe /store C:\Boot\BCD /create /application osloader

Running this command will return a Globally Unique IDentifier (GUID) value - e.g. {bdaf610c-622d-11df-a7ee-a711d7fae90e}. In all subsequent commands replace {guid} with this value and replace {ramdisk_guid} with the GUID created by running the command in step 1 -

bcdedit.exe /store C:\Boot\BCD /set {guid} detecthal Yes
bcdedit.exe /store C:\Boot\BCD /set {guid} winpe Yes
bcdedit.exe /store C:\Boot\BCD /set {guid} osdevice ramdisk=[C:]\Sources\boot.wim,{ramdisk_guid}
bcdedit.exe /store C:\Boot\BCD /set {guid} device ramdisk=[C:]\Sources\boot.wim,{ramdisk_guid}
bcdedit.exe /store C:\Boot\BCD /set {guid} description "Windows PE"
bcdedit.exe /store C:\Boot\BCD /displayorder {guid} /addlast
o.v
  • 361
0

Every object in Windows BCD store has a GUID which can be used to link that object where appropriate.

You can use Visual BCD Editor to create a separate device options object for every wim loader. Name the Description elements in these objects accordingly to your needs.

Then substitute the corresponding GUID in every Application Device and OS Device element for every loader as needed.

{ramdiskoptions} is just a device options object with a predefined fixed GUID.

See also explanations of how objects in BCD are linked on Windows 7 VHD boot.

snayob
  • 4,500
0

Due to a bug any subsequent WinPE based objects do not display their own descriptions if a {ramdiskoptions} description has been set.

So

2) bcdedit /store %STR% /create {ramdiskoptions} /d "Ramdisk Options"

Should be changed to

2) bcdedit /store %STR% /create {ramdiskoptions} 

This small trick perfectly fixed the boot manager items all showed as "Ramdisk Options" problem of my all PEs based on Win8/Win10 till the latest Win10 2004 Edition.

Here is a sample script.

rem Creates BCD (boot configuration data) for three Windows PE 2.0 images or later
rem This script must be running in windows 7/8/10 and run as administrator
rem Or you can run it in the PE 2.or later environment
rem
Rem This script based on the Win10 Installation USB drive
Rem Put you PE wim file inside the \boot folder
Rem Put this script inside the \boot folder
Rem Modifi this script, change the description and the wim file name the match you wim file
Rem At last, run this script to generate BCD file.
Rem ** If you want to change the Boot menut of the UEFI boot, copy the new BCD file to \efi\microsoft\boot\ folder

set BCD-File=.\BCD del %BCD-File%.bak ren %BCD-File% bcd.bak pause Bcdedit -createstore %BCD-File% Bcdedit -store %BCD-File% -create {ramdiskoptions} Bcdedit -store %BCD-File% -set {ramdiskoptions} ramdisksdidevice boot Bcdedit -store %BCD-File% -set {ramdiskoptions} ramdisksdipath \boot\boot.sdi

for /f "tokens=1-3" %%a in ('Bcdedit -store %BCD-File% -create /d "1. Win8PEx64 XiaoBai" /application osloader') do set guid4=%%c Bcdedit -store %BCD-File% -set %guid4% systemroot \Windows Bcdedit -store %BCD-File% -set %guid4% detecthal Yes Bcdedit -store %BCD-File% -set %guid4% winpe Yes Bcdedit -store %BCD-File% -set %guid4% osdevice ramdisk=[boot]\Boot\xiaobaiNT63PEX64.WIM,{ramdiskoptions} Bcdedit -store %BCD-File% -set %guid4% device ramdisk=[boot]\Boot\xiaobaiNT63PEX64.WIM,{ramdiskoptions}

for /f "tokens=1-3" %%a in ('Bcdedit -store %BCD-File% -create /d "2. Windows 10 x64 Installation" /application osloader') do set guid6=%%c Bcdedit -store %BCD-File% -set %guid6% device ramdisk=[boot]\sources\boot.WIM,{ramdiskoptions} Bcdedit -store %BCD-File% -set %guid6% path \windows\system32\boot\winload.exe Bcdedit -store %BCD-File% -set %guid6% osdevice ramdisk=[boot]\sources\boot.WIM,{ramdiskoptions} Bcdedit -store %BCD-File% -set %guid6% systemroot \Windows Bcdedit -store %BCD-File% -set %guid6% detecthal Yes Bcdedit -store %BCD-File% -set %guid6% winpe Yes

Bcdedit -store %BCD-File% -create {bootmgr} /d "Windows PE Boot Manager" Bcdedit -store %BCD-File% -set {bootmgr} timeout 10 Bcdedit -store %BCD-File% -set {bootmgr} displayorder %guid4% %guid6% Bcdedit -store %BCD-File% /enum all

Figer
  • 1