How to create a Windows PE boot disk

Some time ago I worked a lot on this topic, and had a good system for creating Windows PE disk, but recently I had to adapt the workflow to changes in the WAIK (Windows Automated Installation Kit) introduced with Windows 7/2008 R2. I won’t go into details on what’s new, but as far as I am concerned it made the whole process quite a bit easier.

Maybe I should explain also what the rest of the Internet will probably tell you: “What is Windows PE?”

Answer: Windows PE is a lightweight version of the Windows operating system.

Why should you care about Win PE?

Answer: Well because you can…

-Access the NTFS shares, map drives and copy data over the network

-Format and partition disks and make bootable USB sticks

-Run admin tools like PsTools, NTPWEdit (password recovery)

-Run WMI and batch scripts to automate Windows 2003 Server / Xp installations

-Edit offline registry of a PC (e.g. change it’s IP address, start/stop services) when you can’t login to the OS for some reason.

It’s been around since Windows Xp (versions 1.x), but only since version 2.0 and now version 3.0 do have some real punch to them. In a way I think it is better than other Windows boot CD’s like Bart and the likes, because you can get MS support and it provides a “clean”,”supported” way to customize it over time with drivers and apps.

Here’s what we will do to get a working WinPE 3.0 boot image:

  1. Download WAIK and install it
  2. Copy files from the WAIK source folder.
  3. Mount the WIM image
  4. Add additional components to the WIM
  5. Integrate drivers into the image
  6. Add applications/other scripts/files to the image
  7. Unmount WIM Image
  8. Burn the image into an ISO file

WAIK Installation

In order to create this WinPE disk you need the WAIK (Windows Automated Installation Kit). This is for WinPE version 3, there are more versions of this WAIK out there, and this tutorial only works for WinPE 3.0.After you’ve downloaded it simply mount and install it. Should you have any issues with the installation (i have some trouble in the days of 2.x) check the contents of the ISO image there should be some file called “wAIKX86.msi” that you can use to launch the installation on a 32b OS, same goes for 64b OS. Installation is pretty simple, next next next.

Copy Required files

I should get this out of the way from the start. These steps are a scripted approach to make a boot disk. While I’m sure there is a GUI somewhere, while I was building my workflow using it was impractical, as I needed a way to reduce user errors and test quickly different approaches in an automated way.

To make this whole process easier make sure you add following paths to your %PATH% environment variable: %PROGRAMFILES%Windows AIK\Tools\PETools

Also create a folder where you have full administrator rights (in this post i use “e:\PE”). Save yourself some headache and use a shortname with no spaces. Needless to say you need to be an administrator on the computer you are using for this task and all of the commands need to be run from an elevated command prompt.

First step is to get ourselves all the files that we will need to make the image. These files are installed by the WAIK installer, and MS also conveniently provides a batch script that copies everything. From the elevated prompt run this:

start /wait cmd /c copype.cmd x86 e:\PE\winpe_x86

We use copype.cmd located under %PROGRAMFILES%Windows AIK\Tools\PETools. The script copies the x86 WinPE files to a customization directory.

Mount the WIM Image

Next we use DISM to mount the boot.wim image and begin servicing it. MS introduced this tool called DISM (Deployment Image Servicing and Management) as a single point of servicing the WinPE image.

cd "%PROGRAMFILES%\windows aik\Tools\x86\Servicing"
Dism.exe /mount-wim /wimfile:"E:\PE\winpe_x86\winpe.wim" /index:1 /mountdir:"E:\PE\winpe_x86\mount"
::list packages installed - do not use quotes in image name
dism /image:E:\PE\winpe_x86\mount /Get-Packages

We mount the image (a .WIM file) to the “e:\PE\winpe_x86\mount” directory. Once we mount the image we can do anything with the files inside the mounted image. I also did a listing of the packages inside the image so you can see what’s inside it. We just have the basics, a language pack, and the foundation. When using dism with /image be careful to not use quotes in the image name.

Add WIM components

Now we can add so called packages to the WIM image. These packages are extra features you may want your image to have, like WMI support, MDAC support, Windows 7/Windows 2008 server setup screens, support for other languages, etc. For a list of the available package for the WinPE x86 version look in %PROGRAMFILES%Windows AIK\Tools\PETools\x86\WinPE_FPs.

cd "%PROGRAMFILES%\windows aik\Tools\x86\Servicing"
::adding packages
Dism /image:e:\PE\winpe_x86\mount /Add-Package /PackagePath:"%programfiles%\Windows AIK\Tools\PETools\x86\<add-your-package-filename-here>"
::add here any other packages you need

For enabling vbs and WMI support add these packages:,,, I’ve added MDAC and HTA packages to the list in case your vbs scripting requires them, There are corresponding packages in the en-us folder, add them aswell, with the syntax above. This is how the output should look like once you run all commands for adding the packages:

In the end run dism /image:E:\PE\winpe_x86\mount /Get-Packages to list the packages you installed.

This covers half the process I described at the start of this post. in the coming days the second part of this tutorial will be finished. I hope you found it useful, have a great week!

Tagged , , . Bookmark the permalink.

2 Responses to How to create a Windows PE boot disk

  1. Pingback: How to create a WinPE boot disk (cont) | Ionuț Nica

  2. Pingback: Boot WindowsPE from USB flash drive | Ionuț Nica