Because my english is so poor, i prefere write a long explanation with short sentences.

I create a VM (generation2 with UEFI) in HyperV.
I disable snapshots ( too many issues with the differential file )
I create a VHDX file (fixed size, GPT/UEFI)
I create the two partitions ( ESR fat32 and System ntfs )
I create the BCD for UEFI
I expand my "customised" winpe in the "system" partition with dism /apply....
So, in the VHDX file, i get a winpe in Flat mode.
Start is OK.

Now i install an application which modifies "files, system hive, software hive".
Because Flat mode, files are ok for the next boot.
System hive is easy to backup and to modify for the next boot.
Software hive is easy to backup for the next boot. No possibility to recopy it at this time because the file is locked

Now i need to boot on a second "small" winpe in the same VHDX file for recopying the two saved hives.
I create a new directory "x:\newWinpe" and expand a second small winpe.
I create a new entry in the BCD file for this second small winpe.
After boot, i can choose between the two "Flat" winpe.
I choose the second small winpe.
I can recopy the two hives in the first big winpe.
And now, when i boot on this first winpe, i retrieve the "new" application. And it works well.

My question : for the second "small" winpe, i want to use a boot.wim (not expanded) file. How can i modify the BCD file for that?

Because of my very poor English, I did not write down all my research or report what I have been manipulating fairly regularly in the last few years. And I understand that they are very difficult for you to invent.

I am familiar with WinPE that I use in various contexts, ISO, Flat, CD/DVD (Ramdisk), USB key/pen, VHD, Hard disk, VM or not....
But this is the first time that I do not find the right solution with this very particular context, VHDX (UEFI/GPT) in a VM with 2 WinPE (one in Flat mode and the other in mode "boot. wim".

I know how to stay humble and recognize that I don't know much, WinPE is too big a topic for me.

I still have to say that the language barrier is such an obstacle to me that what appears to you simple and obvious is to me as an Egyptian text. That's why I use very little software like grub4dos or others. Please do not hold it against me.

As soon as I can restart my tests (2-3 days), I will post a link here to make available the various bcdedit commands and the associated contents of BCD. Maybe you'll see my mistake?

Please, can you post a 'dir boot.sdi' and 'dir boot.wim' ? The result should include boot.sdi and boot.wim.Is boot.sdi located at the EFI ESR partion, or at another partition?And post a 'bcdedit.exe /store bcd /enum all' ? (change directory to the bcd file first)