A. The Windows Automated Installation Kit (WAIK) 1.1 makes it easy to create a customized PE environment for x86 or x64, but I wanted to create a bootable USB or ISO image that had both x86 and x64 versions. It turns out this is easy to do.

  1. Create an x86 WinPE 2.1 environment and an x64 WinPE 2.1 environment. Create each environment in its own folder, such as d:\temp\winpex86 and d:\temp\winpex64.
  2. You're going to use the x64 folder as your base. Go into the sources folder in the x64 folder and rename the file boot.wim to bootx64.wim.
  3. Change the boot configuration data (BCD) to point to bootx64.wim instead of boot.wim. Start a command prompt window with administrator credentials (press Start, type cmd, then right-click the command prompt item and choose Run As Administrator) and use the following commands. You'll pass the path to the BCD you're editing, d:\temp\winpex64\iso\boot\bcd. Make sure to replace the GUID of the RAM disk for the existing value you have on your boot configuration database entry.
    C:\Windows\system32>bcdedit /store d:\temp\winpex64\iso\boot\bcd /enum                              Windows Boot Manager                              --------------------                              identifier \{bootmgr\}                              description Windows Boot Manager                              locale en-US                              inherit \{globalsettings\}                              default \{default\}                              displayorder \{default\}                              toolsdisplayorder \{memdiag\}                              timeout 30                              Windows Boot Loader                              -------------------                              identifier \{default\}                              device ramdisk=\[boot\]\sources\boot.wim,\{7619dcc8-fafe-11d9-b411                              -000476eba25f\}                              path \windows\system32\boot\winload.exe                              description Windows Setup                              locale en-US                              inherit \{bootloadersettings\}                              osdevice ramdisk=\[boot\]\sources\boot.wim,\{7619dcc8-fafe-11d9-b411                              -000476eba25f\}                              systemroot \windows                              detecthal Yes                              winpe Yes                              ems Yes                              C:\Windows\system32>bcdedit /store d:\temp\winpex64\iso\boot\bcd
    /set \{default\} device ramdisk=\[boot\]\sources\bootamd64.wim,
    \{7619dcc8-fafe-11d9-b411-000476eba25f\} The operation completed successfully. C:\Windows\system32>bcdedit /store d:\temp\winpex64\iso\boot\bcd
    /set \{default\} osdevice ramdisk=\[boot\]\sources\bootamd64.wim,
    \{7619dcc8-fafe-11d9-b411-000476eba25f\} The operation completed successfully. C:\Windows\system32>bcdedit /store d:\temp\winpex64\iso\boot\bcd
    /set \{default\} description "PE AMD64" The operation completed successfully. C:\Windows\system32>bcdedit /store d:\temp\winpex64\iso\boot\bcd /enum Windows Boot Manager -------------------- identifier \{bootmgr\} description Windows Boot Manager locale en-US inherit \{globalsettings\} default \{default\} displayorder \{default\} toolsdisplayorder \{memdiag\} timeout 30 Windows Boot Loader ------------------- identifier \{default\} device ramdisk=\[boot\]\sources\bootamd64.wim,\{7619dcc8-fafe-11d9 -b411-000476eba25f\} path \windows\system32\boot\winload.exe description PE AMD64 locale en-US inherit \{bootloadersettings\} osdevice ramdisk=\[boot\]\sources\bootamd64.wim,\{7619dcc8-fafe-11d9 -b411-000476eba25f\} systemroot \windows detecthal Yes winpe Yes ems Yes
  4. Copy the boot.wim from the x86 folder into the sources folder of the x64 (the same folder as the bootx64.wim) and rename it to bootx86.wim.
  5. Add a boot entry for bootx86.wim. When you copy the boot configuration database record for default, take note of the GUID it generates, because you'll make changes to this new entry. Once again, when specifying the GUID after the name of the WIM it should be the same GUID used above, as it represents the RAM disk.
                                  C:\Windows\system32>bcdedit /store d:\temp\winpex64\iso\boot\bcd /copy
    \{default\} /d "PE x86" The entry was successfully copied to \{3de9d48e-e7cc-11dd-a3f7-002170a954ba\}. C:\Windows\system32>bcdedit /store d:\temp\winpex64\iso\boot\bcd /set
    \{3de9d48e-e7cc-11dd-a3f7-002 170a954ba\} osdevice ramdisk=\[boot\]\sources\bootx86.wim,\{7619dcc8-fafe-11d9-b411- 000476eba25f\} The operation completed successfully. C:\Windows\system32>bcdedit /store d:\temp\winpex64\iso\boot\bcd /set
    \{3de9d48e-e7cc-11dd-a3f7-002 170a954ba\} device ramdisk=\[boot\]\sources\bootx86.wim,\{7619dcc8-fafe-11d9-b411-00 0476eba25f\} The operation completed successfully. C:\Windows\system32>bcdedit /store d:\temp\winpex64\iso\boot\bcd
    -displayorder \{3de9d48e-e7cc-11dd -a3f7-002170a954ba\} -addlast The operation completed successfully. C:\Windows\system32>bcdedit /store d:\temp\winpex64\iso\boot\bcd /enum Windows Boot Manager -------------------- identifier \{bootmgr\} description Windows Boot Manager locale en-US inherit \{globalsettings\} default \{default\} displayorder \{default\} \{3de9d48e-e7cc-11dd-a3f7-002170a954ba\} toolsdisplayorder \{memdiag\} timeout 30 Windows Boot Loader ------------------- identifier \{default\} device ramdisk=\[boot\]\sources\bootamd64.wim,\{7619dcc8-fafe-11d9 -b411-000476eba25f\} path \windows\system32\boot\winload.exe description PE AMD64 locale en-US inherit \{bootloadersettings\} osdevice ramdisk=\[boot\]\sources\bootamd64.wim,\{7619dcc8-fafe-11d9 -b411-000476eba25f\} systemroot \windows detecthal Yes winpe Yes ems Yes Windows Boot Loader ------------------- identifier \{3de9d48e-e7cc-11dd-a3f7-002170a954ba\} device ramdisk=\[boot\]\sources\bootx86.wim,\{7619dcc8-fafe-11d9-b 411-000476eba25f\} path \windows\system32\boot\winload.exe description PE x86 locale en-US inherit \{bootloadersettings\} osdevice ramdisk=\[boot\]\sources\bootx86.wim,\{7619dcc8-fafe-11d9-b 411-000476eba25f\} systemroot \windows detecthal Yes winpe Yes ems Yes
  6. Click to expand

    We now have the WIM files for both PE environments in one sources folder and the boot configuration database will display a menu to select which you want to use. At this point, you can copy the ISO folder to a USB device (which you've made active) or make an ISO using the usual methods. An ISO I created using the instructions above is shown here.
Related Reading:
Check out hundreds more useful Q&As like this in John Savill's FAQ for Windows. Also, watch instructional videos made by John at ITTV.net.