Share via


Create bootable Windows PE media

The Windows Assessment and Deployment Kit (ADK) deployment tools and ADK Windows PE Add-ons, include command-line utilities that make it easy to create bootable WinPE media:

  • CopyPE creates a working set of Windows PE files
  • MakeWinPEMedia uses the working set of files to create bootable Windows PE media. MakeWinPEMedia can create bootable Windows PE USB drives, virtual hard disks, or ISOs that allow you to boot a VM or burn to a DVD or CD.

Note

If you're using the ADK for Windows 10, version 1803 or earlier, Windows PE is included in the ADK when you choose the Windows Preinstallation environment option during setup and doesn't require a separate addon.

Update the Windows PE add-on for the Windows ADK

Important

The April 9, 2024 Windows security updates should be applied to the Windows PE add-on for the Windows ADK 10.1.25398.1 (September 2023) and earlier, for the ADK for Windows Server 2022, and for the ADK for Windows 10 version 2004 and earlier.

Prior to creating the bootable Windows PE media, you can apply updates to the Windows PE image and the boot media found in the Windows PE add-on for the Windows ADK. This step needs to be done only once for each update. Subquently, all bootable Windows PE media created from the updated Windows PE add-on for the Windows ADK will have the update applied.

  1. Make sure your PC has the ADK and ADK Windows PE add-on installed.

  2. Start the Deployment and Imaging Tools Environment as an administrator.

  3. Navigate to the "Windows Preinstallation Envrionment" folder and the processor architecture folder of your choice. See sample command for the amd64 folder:

    cd "..\Windows Preinstallation Environment\amd64"
    
  4. Mount the Windows PE boot image.

    md C:\WinPE_amd64\mount
    Dism /Mount-Image /ImageFile:"en-us\winpe.wim" /index:1 /MountDir:"C:\WinPE_amd64\mount"
    
  5. Apply Windows Update to the mounted image

  6. While the Windows PE boot image is mounted, copy boot files back to the Windows PE add-on installation.

    Important

    You will need to choose the correct boot media based on the target device's revocation state for Windows UEFI 2011 CA signed boot managers, see KB5025885 to learn more.

    Xcopy "c:\WinPE_amd64\mount\Windows\Boot\EFI_EX\bootmgr_EX.efi" "Media\bootmgr.efi" /Y
    Xcopy "c:\WinPE_amd64\mount\Windows\Boot\EFI_EX\bootmgfw_EX.efi" "Media\EFI\Boot\bootx64.efi" /Y
    Xcopy "C:\WinPE_amd64\mount\Windows\Boot\Fonts_EX\chs_boot_EX.ttf" "Media\EFI\Microsoft\Boot\Fonts\chs_boot.ttf" /Y /-I
    Xcopy "C:\WinPE_amd64\mount\Windows\Boot\Fonts_EX\cht_boot_EX.ttf" "Media\EFI\Microsoft\Boot\Fonts\cht_boot.ttf" /Y /-I
    Xcopy "C:\WinPE_amd64\mount\Windows\Boot\Fonts_EX\jpn_boot_EX.ttf" "Media\EFI\Microsoft\Boot\Fonts\jpn_boot.ttf" /Y /-I
    Xcopy "C:\WinPE_amd64\mount\Windows\Boot\Fonts_EX\kor_boot_EX.ttf" "Media\EFI\Microsoft\Boot\Fonts\kor_boot.ttf" /Y /-I
    Xcopy "C:\WinPE_amd64\mount\Windows\Boot\Fonts_EX\malgun_boot_EX.ttf" "Media\EFI\Microsoft\Boot\Fonts\malgun_boot.ttf" /Y /-I
    Xcopy "C:\WinPE_amd64\mount\Windows\Boot\Fonts_EX\malgunn_boot_EX.ttf" "Media\EFI\Microsoft\Boot\Fonts\malgunn_boot.ttf" /Y /-I
    Xcopy "C:\WinPE_amd64\mount\Windows\Boot\Fonts_EX\meiryo_boot_EX.ttf" "Media\EFI\Microsoft\Boot\Fonts\meiryo_boot.ttf" /Y /-I
    Xcopy "C:\WinPE_amd64\mount\Windows\Boot\Fonts_EX\meiryon_boot_EX.ttf" "Media\EFI\Microsoft\Boot\Fonts\meiryon_boot.ttf" /Y /-I
    Xcopy "C:\WinPE_amd64\mount\Windows\Boot\Fonts_EX\msjh_boot_EX.ttf" "Media\EFI\Microsoft\Boot\Fonts\msjh_boot.ttf" /Y /-I
    Xcopy "C:\WinPE_amd64\mount\Windows\Boot\Fonts_EX\msjhn_boot_EX.ttf" "Media\EFI\Microsoft\Boot\Fonts\msjhn_boot.ttf" /Y /-I
    Xcopy "C:\WinPE_amd64\mount\Windows\Boot\Fonts_EX\msyh_boot_EX.ttf" "Media\EFI\Microsoft\Boot\Fonts\msyh_boot.ttf" /Y /-I
    Xcopy "C:\WinPE_amd64\mount\Windows\Boot\Fonts_EX\msyhn_boot_EX.ttf" "Media\EFI\Microsoft\Boot\Fonts\msyhn_boot.ttf" /Y /-I
    Xcopy "C:\WinPE_amd64\mount\Windows\Boot\Fonts_EX\segmono_boot_EX.ttf" "Media\EFI\Microsoft\Boot\Fonts\segmono_boot.ttf" /Y /-I
    Xcopy "C:\WinPE_amd64\mount\Windows\Boot\Fonts_EX\segoe_slboot_EX.ttf" "Media\EFI\Microsoft\Boot\Fonts\segoe_slboot.ttf" /Y /-I
    Xcopy "C:\WinPE_amd64\mount\Windows\Boot\Fonts_EX\segoen_slboot_EX.ttf" "Media\EFI\Microsoft\Boot\Fonts\segoen_slboot.ttf" /Y /-I
    Xcopy "C:\WinPE_amd64\mount\Windows\Boot\Fonts_EX\wgl4_boot_EX.ttf" "Media\EFI\Microsoft\Boot\Fonts\wgl4_boot.ttf" /Y /-I
    
    • To create Windows UEFI 2011 CA signed Windows PE boot media:
    Xcopy "C:\WinPE_amd64\mount\Windows\Boot\EFI\bootmgr.efi" "Media\bootmgr.efi" /Y
    Xcopy "C:\WinPE_amd64\mount\Windows\Boot\EFI\bootmgfw.efi" "Media\EFI\Boot\bootx64.efi" /Y
    
  7. Unmount the WinPE image, committing changes.

    Dism /Unmount-Image /MountDir:"C:\WinPE_amd64\mount" /commit
    

Step 1: Create working files

No matter what type of media you're going to create, the first thing to do is create a working set of Windows PE files on your technician PC.

  1. Make sure your PC has the ADK and ADK Windows PE add-on installed.

  2. Start the Deployment and Imaging Tools Environment as an administrator.

  3. Run copype to create a working copy of the Windows PE files. For more information about copype, see Copype command line options.

    copype amd64 C:\WinPE_amd64
    

Step 2: Customize Windows PE

The customizations below are common, but not every Windows PE image requires customizations. When you add packages to Window PE, it can slow performance and boot time. Only add additional packages when necessary.

Common customizations

  • For Windows 11: If you're launching Windows Setup from Window PE, add the WinPE-WMI and WinPE-SecureStartup optional components. If you don't include these optional components, you may see an error that your PC doesn't meet the minimum hardware requirements.
  • Add an update. To learn more, see: WinPE: mount and customize.
  • Add a video or network driver. (Windows PE includes generic video and network drivers, but in some cases, additional drivers are needed to show the screen or connect to the network.). To learn more, see WinPE: Add drivers.
  • Add PowerShell scripting support. To learn more, see WinPE: Adding Windows PowerShell support to Windows PE. PowerShell scripts are not included in this lab.
  • Set the power scheme to high-performance. Speeds deployment. Note, our sample deployment scripts already set this scheme automatically. See WinPE: Mount and Customize: High Performance.
  • Optimize Windows PE: Recommended for devices with limited RAM and storage (for example, 1GB RAM/16GB storage). After you add drivers or other customizations to Windows PE, see Image optimization to help reduce the boot time.

Step 3: Create bootable media

Now that you now have a set of working files, you can use MakeWinPEMedia to build bootable WinPE media.

Create a bootable Windows PE USB drive

  1. Attach a USB drive to your technician PC.

  2. Start the Deployment and Imaging Tools Environment as an administrator.

  3. Optional You can format your USB key prior to running MakeWinPEMedia. MakeWinPEMedia will format your Windows PE drive as FAT32. If you want to be able to store files larger than 4GB on your Windows PE USB drive, you can create a multipartition USB drive that has an additional partition formatted as NTFS. See Create a multipartition USB drive for instructions.

  4. Use MakeWinPEMedia with the /UFD option to format and install Windows PE to the USB flash drive, specifying the USB key's drive letter:

    MakeWinPEMedia /UFD C:\WinPE_amd64 P:
    

    Warning

    This command reformats the partition.

    See MakeWinPEMedia command line options for all available options.

The bootable Windows PE USB drive is ready. You can use it to boot a PC into Windows PE.

Create a WinPE ISO, DVD, or CD

  1. Use MakeWinPEMedia with the /ISO option to create an ISO file containing the Windows PE files:

    MakeWinPEMedia /ISO C:\WinPE_amd64 C:\WinPE_amd64\WinPE_amd64.iso
    
  2. Optional Burn a DVD or CD: In Windows Explorer, right-click the ISO file, and select Burn disc image > Burn, and follow the prompts.

Create a Windows PE VHD to use with Hyper-V

You can create a bootable VHD to use with Hyper-V.

Tip

If you're planning to run Windows PE in Hyper-V, consider using an ISO file format instead of a VHD to enable faster setup of the virtual PC.

To install Windows PE to a VHD:

  1. Create a virtual hard drive (.vhdx):

    diskpart
    create vdisk file="C:\WinPE.vhdx" maximum=1000
    attach vdisk
    create partition primary
    assign letter=V
    format fs=ntfs quick
    exit
    
  2. Prepare the drive by using MakeWinPEMedia:

    MakeWinPEMedia /UFD C:\WinPE_amd64 V:
    
  3. Detach the drive:

    diskpart
    select vdisk file="C:\WinPE.vhdx"
    detach vdisk
    exit
    

Boot from the media you created

Now that you've created bootable Windows PE media, you can use it to boot your PC.

  1. Insert the media into the PC you want to boot.
  2. Turn on the PC.
  3. Press the key or key combination that will bring up the boot menu. This key or key combination is different depending on your PC manufacturers. If you don't know which key combination will bring up your PC's boot menu, contact your PC manufacturer.
  4. From the boot menu, select the bootable Windows PE media.

Your PC will boot into Windows PE.

Troubleshooting

  1. If Windows PE doesn't appear, try the following workarounds, rebooting the PC each time:

    • To boot a PC that supports UEFI mode: In the firmware boot menus, try manually selecting the boot files: \EFI\BOOT\BOOTX64.EFI.
    • If your PC requires storage or video drivers to boot, try adding those same drivers to the Windows PE image. For more information, see WinPE: Mount and Customize.
  2. If the PC doesn't connect to network locations, see WinPE Network Drivers: Initializing and adding drivers.

Windows PE overview

WinPE: Install on a Hard Drive (Flat Boot or Non-RAM)

WinPE: Mount and Customize

WinPE: Boot in UEFI or legacy BIOS mode

Windows Setup Supported Platforms and Cross-Platform Deployments