Q. How can I create a Windows Preinstallation Environment (WinPE) 2.1 boot image that has both x86 and x64 versions?

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<br>/set \{default\} device ramdisk=\[boot\]\sources\bootamd64.wim,<br>\{7619dcc8-fafe-11d9-b411-000476eba25f\}
    The operation completed successfully.

    C:\Windows\system32>bcdedit /store d:\temp\winpex64\iso\boot\bcd<br>/set \{default\} osdevice ramdisk=\[boot\]\sources\bootamd64.wim,<br>\{7619dcc8-fafe-11d9-b411-000476eba25f\}
    The operation completed successfully.

    C:\Windows\system32>bcdedit /store d:\temp\winpex64\iso\boot\bcd<br>/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<br>\{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<br>\{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<br>\{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<br>-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.

Discuss this Article 1

chewy
on Mar 10, 2013
Thanks for the great article - it helped me to understand bcdedit a bit. What I want to achieve is creating a usb device that can start x86/x64 WinPE, but by default starts system from first partition (equivalent to grub hd(0, 0)). It seems fairly simple - just add an entry with device/osdevice set to partition=C:. The problem is it doesn't work for both computers with and without the boot partition (100mb by default for win7). I noticed that when I use bcdedit to set device on one computer, it is marked as "unknown" on the other one (and vice versa). I could add both options but I'd like the system to boot even if the drive is connected (hence "default" will work for only one computer type). Do you know if there's a possibility to solve this problem? Some "goto other-option if this fails" or even a proper solution (rather than a workaround)? I think I reached limits of my knowledge in this subject - I've spent hours on google'ing and reading but haven't found what I'm looking for. Any help much appreciated.

Please or Register to post comments.

IT/Dev Connections

Las Vegas
September 30th - October 4th

Paul ThurottYou'll have the opportunity to experience:
• The Microsoft
Technology Roadmap
• Office 365 Implementation
• Hyper-V Optimizing
• Windows 8 Deployment
and much more!

Come See Paul Thurrott & Rod Trent in Person!

Early Registration Now Open

Upcoming Training

Mastering SharePoint 2013: Succeeding, Not Just Surviving

Building on the success of the “Mastering SharePoint 2010” seminars, the presenters have updated the content to cover the latest and greatest SharePoint product: SharePoint 2013. While SharePoint 2013 is relatively new on the marketplace, the presenters have been working with SharePoint 2013 for well over a year, and have implemented it with a number of clients in production environments.

Register Now

Current Issue

May 2013 - The NameTranslate object is useful when you need to translate Active Directory object names between different formats, but it's awkward to use from PowerShell. Here's a PowerShell script that eliminates the awkwardness.

CURRENT ISSUE / ARCHIVE / SUBSCRIBE

Windows Forums

Get answers to questions, share tips, and engage with the Windows Community in our Forums.