Down and Dirty WinPE USB for Surface



AskPFEPlat is in the process of a transformation to the new Core Infrastructure and Security TechCommunity, and will be moving by the end of March 2019 to our new home at (hosted at Please bear with us while we are still under construction!

We will continue bringing you the same great content, from the same great contributors, on our new platform. Until then, you can access our new content on either as you do today, or at our new site Please feel free to update your bookmarks accordingly!

Why are we doing this? Simple really; we are looking to expand our team internally in order to provide you even more great content, as well as take on a more proactive role in the future with our readers (more to come on that later)! Since our team encompasses many more roles than Premier Field Engineers these days, we felt it was also time we reflected that initial expansion.

If you have never visited the TechCommunity site, it can be found at On the TechCommunity site, you will find numerous technical communities across many topics, which include discussion areas, along with blog content.

NOTE: In addition to the AskPFEPlat-to-Core Infrastructure and Security transformation, Premier Field Engineers from all technology areas will be working together to expand the TechCommunity site even further, joining together in the technology agnostic Premier Field Engineering TechCommunity (along with Core Infrastructure and Security), which can be found at!

As always, thank you for continuing to read the Core Infrastructure and Security (AskPFEPlat) blog, and we look forward to providing you more great content well into the future!


Hi everybody! My name is Stephen Mathews and you may know me from my 3-part PowerShell Basics video series on Taste of Premier. Today I’m here to show how to create a bootable Windows PreInstallation Environment USB drive to use on our Microsoft Surface devices.

I was onsite with one of my customers, as a Premier Field Engineer often is, and was asked how to wipe a Surface device. My go-to method is to insert my trusty Windows-To-Go USB and boot into my Operating System, and then use Disk Manager to delete and format the host’s now attached hard drive; unfortunately, I had left my WTG drive at home. The alternate method I use to access WinPE is to PXE boot the machine into the customer’s Microsoft Deployment Toolkit on their Windows Deployment Server; however, the customer’s Surface had no network connectivity.

You can also use MDT to create bootable media allowing access to the WinPE directly on a USB drive instead of using PXE boot, alternately, most image customization tools introduce a WinPE prior to deployment as well. Alas, the admins I was working with did not have access to the MDT server and I didn’t want them to have to use DISM, ImageX, or BCDEdit programs either, I just needed a simple WinPE that they could create at their desks. After quite a few rounds of trial and error, I arrived at a 3 step solution:

Step 1: Create a bootable USB drive

Attach an empty (or soon to be erased) USB drive to your system. I used an ancient 1GB USB flash drive that the customer found in an equally ancient desk drawer.

c:\windows\system32> diskpart

diskpart> list disk

diskpart> select disk #

diskpart> clean

diskpart> create partition primary

diskpart> select partition 1

diskpart> active

diskpart> format fs=fat32 quick

diskpart> assign letter x


Reference: Prepare the UFD

Step 2: Download and Install the WinPE tools

Download the Windows ADK for your operating system here.

Install Windows PreInstallation Environment (Windows PE), you can deselect the other components.


Open the Deployment and Imaging Tools and run the copype command with the amd64 architecture.

<ADK Install Path> copype.cmd amd64 c:\temp\winpe_amd64

Copy the resulting media folder to the root of the USB drive. In the screenshot, I’m sending the output to a log file, this is not necessary. The “/xd” switch is skipping the additional language copies of the boot files, that can be dropped as well. The copy may take a few minutes based on the speed of your USB device.

robocopy c:\temp\winpe_amd64\media x: /e /xd *-*


Reference: Set up a Windows PE build environment

Step 3: Boot from USB drive

Change the boot order in the Surface device to put USB before the SSD. It took me quite a few attempts to get the right timing of Power + Volume Up buttons, I recommend patience during this process.

Configure Alternate System Boot Order > USB -> SSD


At this point, it should boot directly into the USB drive. The screen will pause at the Surface logo while the USB is read. If it goes directly to the spinning dots, then it did not boot to USB successfully. Pardon the image, although I think the faux sunburst is a nice touch.


Note: For older Surfaces and/or if there’s no boot order setting, press Power + Volume Down to boot from USB.

Reference: How do I use the BIOS/UEFI?

Once I was in the WinPE I used the diskpart commands in Step 1 to delete all the disk’s partition information, re-partition into a single partition, and finally format it without the quick parameter since we wanted to overwrite the entire drive.


There you go, a simple USB bootable WinPE with all your favorite System32 executables available, all wrapped in a 250MB package. I hope this was useful to you and saves you time in the future.

Thanks for reading,

Stephen Mathews, Platforms PFE