Add an entry to BCD
===================
Usually, the {ramdiskoptions} entry is not created when installing Windows. Just make sure if it is there or not with the following command.
bcdedit /enum {ramdiskoptions}
If it says "There are no matching objects or the store is empty", that indicates {ramdskoptions} entry has not been created. Create it with the following commands.
bcdedit /create {ramdiskoptions}
bcdedit /set {ramdiskoptions} ramdisksdidevice boot
bcdedit /set {ramdiskoptions} ramdisksdipath \boot\boot.sdi
Now, create the actual entry with following commands.
bcdedit /create /d "WinPE boot" /application osloader
After successfully creating the entry, this will display the {GUID} of the entry in format {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}.
Use that value in the following commands.
bcdedit /set {GUID} device ramdisk=[C:]\Images\winpe.wim,{ramdiskoptions}
bcdedit /set {GUID} osdevice ramdisk=[C:]\Images\winpe.wim,{ramdiskoptions}
bcdedit /set {GUID} systemroot \Windows
bcdedit /set {GUID} detecthal Yes
bcdedit /set {GUID} WinPE Yes
Finally, add it to the current boot options list with
bcdedit /displayorder {GUID} /addlast
Reboot the system and select WInPE boot to boot to WinPE
Notes:
In boot menu, if "Ramdisk Options" is displayed instead of the description of WinPE, remove the description of the {ramdiskoptions} with the following command.
bcdedit /deletevalue {ramdiskoptions} description
If booting to winpe fails and says "A required device is not accessible", check if you have copied the boot.sdi file to the correct location.