James O'Neill's Blog

November 11, 2006

Customizing Windows PE

Filed under: Windows Vista — jamesone111 @ 11:07 pm

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: , , , ,

This post originally appeared on my technet blog.


Create a free website or blog at WordPress.com.

%d bloggers like this: