Customizing Windows PE

In "Getting started with Windows PE" I said that (once you have got the Windows AIK) the stages were

  1. Copy the Windows PE source files somewhere,
  2. Customize Windows PE 
  3. Put it on a bootable USB key or
    make an ISO and burn that to a CD

Stage 1 uses Copype.cmd to put the Windows PE files somewhere you can create the image; Stage 3 uses OScdIMG to make a CD Image of the OS from the "ISO" folder, or you can copy that folder to a usb key.

Which leaves stage 2

One customization is to add utilities to the bootable PE media, e.g. the ImageX tool and the associated wimscript.ini. Simply copy these to the ISO folder, e.g.

md c:\WinPE_x86\iso\[your stuff]
copy [your stuff] c:\WinPE_x86\iso\[your stuff]

A classic thing to include is the imageX utility. Something has changed with this: it no longer needs an INI file to tell it what to exclude - I gave out duff information on this at the event in London on Friday. Doh!
The other customization is to change what is installed in Windows PE the image you're going to boot from. This is held in a WIM file which is extracted into a RAM disk at boot time.  To do this:

STEP 1 Use IMAGEX to apply the image in copy of boot.wim to a folder, e.g

imagex /apply winpe.wim 1 c:\WinPE_x86\mount

STEP 2 Make the changes

Then copy the modified WIM then goes into the ISO\SOURCES\BOOT.WIM  

Some Windows components are included but not installed with the image

  • WinPE-HTA-Package: HTML Application support
  • WinPE-MDAC-Package: Microsoft Data Access Component support
  • WinPE-Scripting-Package: Windows Script Host support
  • WinPE-SRT-Package:Windows Recovery Environment component
  • WinPE-XML-Package: Microsoft XML (MSMXL) Parser support

These can be added with the peimg tool.e.g.

peimg  /install=WinPE-HTA-Package "C:\WinPE_x86\mount"

I'd suggest using peimg /install=* if you're building a CD.
You can also add drivers with the PE imageTool e.g.

peimg  /inf="C:\Install Files\MyDevice\Device.INF" "C:\WinPE_x86\mount"

I tried this with a the driver for my old digital camera which isn't recognised as storage drive withouth installing a driver; the driver is Once you have tweaked the image to the way you want it you can optimize it for size with

peimg /prep

Step 3 Use IMAGEX a second time to Capture the IMAGE back to a bootable WIM file, e.g

imagex.exe " /boot /compress max /capture "C:\WinPE_x86\mount" "C:\WinPE_x86\ISO\SOURCES\BOOT.WIM "  "MyNewPE"

And now you're ready for OScdIMG or copying to a USB key.


Technorati tags: , , , ,
Comments (5)
  1. Anonymous says:

    Matt McSpirit IM’d me a couple of days ago to ask if I’d built a custom Windows Vista installation DVD.

  2. Anonymous says:

    If you are anything like me, you know as well as I do, you can’t beat a wipe and reload of your PC to

  3. Anonymous says:

    Microsoft Windows Vista has been designed from the ground up to be easy to deploy. The guys introduced

  4. Anonymous says:

    This posting describes, how you can use the Windows Automated Installation Toolkit (WAIK) to create images of your development machines and restore those images using imagex.exe. It furthermore describeds, how-to create a Windows PE version which you

Comments are closed.

Skip to main content