You are on page 1of 8

Walkthrough: Create a Custom Windows

PE Image
223 out of 271 rated this helpful
This walkthrough descries how to create a customi!ed Windows PE image" The primar# tool for customi!ing
Windows PE 2"$ is PEImg% a Windows PE command&line tool" 'fter creating a customi!ed image% #ou can deplo# the
image to a hard disk or create a ootale Windows PE (') disk on a C*&(+)% a ,-. flash dri/e 0,1*2 or a hard disk"
' Windows PE (') disk oots directl# into memor# and is assigned the dri/e letter 3% which does not correspond
to the media 0for e4ample% a ,1* or a C*&(+)2 from which #ou ooted" Ensure that #ou ha/e sufficient memor#
to support the si!e of #our Windows PE image plus an# additional memor# re5uirements% for e4ample% if #ou plan
on running an# customi!ed applications that need additional working memor#"
To complete this walkthrough% #ou need the following:
' technician computer that pro/ides all the tools and the source files" 1or more information% see .uilding a
Technician Computer"
-tep 1: -et up a Windows PE .uild En/ironment
In this step% #ou create a re5uired director# structure that supports uilding a Windows PE image"
+n #our technician computer% click Start% point to All Programs% point to Windows OPK or Windows AIK%
and then click Windows PE Tools Command Prompt"
The menu shortcut opens a Command Prompt window and automaticall# sets en/ironment /ariales to point
to all the necessar# tools" .# default% all tools are installed at C:6Program 1iles6version6Tools% where version can
e Windows OPK or Windows AIK"
't the command prompt% run the Copype.cmd script" The script re5uires two arguments: hardware
architecture and destination location" 1or e4ample%
where 7architecture8 can e x8% amd!% or ia! and 7destination8 is a path to the local director#" 1or
The script creates the following director# structure and copies all the necessar# files for that architecture" 1or
copype.cmd <architecture> <destination>
copype.cmd x86 c:\winpe_x86
Walkthrough: Create a Custom Windows PE Image,v=ws.10).aspx
1 of 8 1/3/2014 5:59 PM
-tep 2: )ount the .ase Windows PE Image
In this step% #ou mount the ase image to a local director# so that #ou can add or remo/e packages"
't the command prompt% mount the ase Windows PE image 0Winpe"wim2 to the 6)ount director# # using
Image3" 1or e4ample%
-tep 3: 'dd 'dditional Packages
.# using the Peimg tool% #ou install Windows features # using the "install option" Windows features are included
with the ase image 0Winpe"wim2 ut are not installed" 9ou can also import packages and add dri/ers and language
packs" 1or more information% see Windows PE Customi!ation :ow&To Topics"
'dd a Windows feature to the ase image # using the peimg "install command" 1or e4ample%
where 7pkg8 denotes the package name" ' list of a/ailale packages and their names can e otained #
using the "list command" 9ou can use wildcards to specif# a package name" 'n# packages with matching
names will e installed" 1or e4ample%
where wildcards denote an# package with :T' in the package name"
Windows PE 2"$ pro/ides the following Windows features referred to as packages"

Pac#age Name $escription
'dditional font support for <a&<p% ko&kr% !h&cn% !h&hk% and !h&tw"
imagex /mountrw c:\winpe_x86\winpe.wim c:\winpe_x86\mount
peimg /insta!!"<p#g> c:\winpe_x86\mount\$indows
peimg /insta!!"$in%&'()*'%ac#age c:\winpe_x86\mount\$indows
peimg /insta!!"+()*+ c:\winpe_x86\mount\$indows
Walkthrough: Create a Custom Windows PE Image,v=ws.10).aspx
2 of 8 1/3/2014 5:59 PM
WinPE&:T'&Package :T)= application support
WinPE&)*'C&Package )icrosoft *ata 'ccess Component support
WinPE&-cripting&Package Windows -cript :ost support
WinPE&-(T&Package Windows (eco/er# En/ironment component 0a/ailale onl# on
the Windows +P>2
WinPE&W)I&Packages Windows )anagement Instrumentation 0W)I2 support
WinPE&3)=&Package )icrosoft 3)= 0)-3)=2 parser support
(epeat -tep 1 for each package" 2"
?erif# that the packages were installed # using the peimg "list command to /iew all packages in the current
image" 1or e4ample%
In the INS column% %&' denotes installed packages and %(' denotes not installed"
-tep @: 0+ptional2 'dd 'dditional Customi!ations
This step is optional ut recommended" 9ou can add applications and scripts to #our Windows PE image that #ou
might need while working in Windows PE" The following is a list of common tools to include in #our Windows PE
' command&line tool for capturing and appl#ing images during deplo#ment scenarios" 1or e4ample% at a
command prompt%
Pac#age *anager %P#gmgr.exe'
' tool for ser/icing Windows image 0"wim2 files offline" 9ou must cop# the entire 6-er/icing folder and )-3)=A
inaries" +ffline ser/icing re5uires Image3" 1or e4ample%
copy %windir%\system32\msxml6*.dll c:\winpe_x86\iso\Servicing
where 7/ersion8 can e Windows +P> or Windows 'I> and 7architecture8 can e x8% amd! or ia!" In
oth pre/ious e4amples% the tools are not loaded into memor# during a Windows PE (') oot" The media
must e a/ailale to access the tools"
To load the tools into memor# along with Windows PE% cop# the source files into the mounted 6Windows
director#" 1or e4ample%
peimg /!ist c:\winpe_x86\mount\$indows
copy ,c:\program -i!es\<.ersion>\)oo!s\x86\imagex.exe/ c:\winpe_x86\iso\
xcopy ,c:\program -i!es\<.ersion>\)oo!s\<architecture>\Ser.icing/ c:\winpe_x86\iso\Se
Walkthrough: Create a Custom Windows PE Image,v=ws.10).aspx
3 of 8 1/3/2014 5:59 PM
'dding files to the 6Windows director# will increase the si!e of #our Windows PE (') image" Ensure that
#our computer has sufficient memor# to oot Windows PE and to run /arious applications"
-tep B: Prepare the Image
In this step% #ou prepare the image # using the peimg "prep command" This operation remo/es an# non&installed
packages from the final image" This operation reduces the o/erall image si!e" 1or e4ample%
The "prep option cannot e re/erted% and after the "prep option is run% the "install% "+ninstall% "import% and "list
options will not function% while the "lang and "in, options will continue to function" The Peimg tool prompts #ou to
confirm the command" To suppress this prompt for scripting% add the ", option"
-tep A: Commit Changes to the Image
In this step% #ou commit the changes to the original image file 0Winpe"wim2 # using the Image3 "+nmo+nt option
with the "commit option" 1or e4ample%
-tep 7: (eplace the *efault .oot"wim 1ile
In this step% #ou replace the default .oot"wim in the 6I-+ director# with #our new customi!ed image" The image must
e called .oot"wim" 1or e4ample%
;e4t -tep
9ou now ha/e a customi!ed Windows PE (') disk image that #ou can place on ootale media% like a C*&(+) or a
To create a ootale C*&(+)
+n #our technician computer% at a command prompt% create an "iso file # using +scdimg" 1or e4ample% 1"
peimg /prep c:\winpe_x86\mount\$indows
imagex /unmount c:\winpe_x86\mount /commit
copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\0oot.wim
Walkthrough: Create a Custom Windows PE Image,v=ws.10).aspx
4 of 8 1/3/2014 5:59 PM
Communit# 'dditions
1or I'&A@ architecture% replace Etfsoot"com with Efis#s"in"
.urn the image 0WinpeC4DA"iso2 to a C*&(+)" 2"
To create a ootale ,1*
*uring a running Windows ?ista operation s#stem or a Windows PE session% insert #our ,1* de/ice" 1"
't a command prompt% use *iskpart to format the de/ice as 1'T32 spanning the entire de/ice% setting the
partition to acti/e" 1or e4ample%
where the /alue of disk 1 is e5ual to UFD"
+n #our technician computer% cop# all the content in the 6I-+ director# to #our ,1* de/ice" 9ou can manuall#
create the director# structure or use the xcopy command to automaticall# uild and cop# the appropriate files
from #our technician computer to #our ,1* de/ice" 1or e4ample%
where c is the letter of #our technician computer hard disk and f is the letter of #our ,1* de/ice"
9ou can further customi!e #our Windows PE image # adding language packs% customi!ed scripts% and dri/ers" 1or
more information% see Windows PE Customi!ation :ow&To Topics"
-ee 'lso
.uilding a Windows PE Image
.ooting Windows PE
(e: PEI)E not a/ailale
'nd in the newer /ersion of W'I>% PEI)E"E3E was replaced # *I-)"e4e" -ee the documentation that gets installed with #our
oscdimg 'n '0c:\winpe_x86\ c:\winpe_x86\ISO c:\winpe_x86\winpe_x86.iso
se!ect dis#
create partition primary si1e"<si1e o->
se!ect partition
-ormat -s"-at23
xcopy c:\winpe_x86\iso\+.+ /s /e /- -:\
Walkthrough: Create a Custom Windows PE Image,v=ws.10).aspx
5 of 8 1/3/2014 5:59 PM
/ersion of W'I>"
PEI)E not a/ailale
.e aware that if #ou are <ust getting into this and start with W'I> A"1 0Windows7 and the -P1 update2 then the PEI)E tool
mentioned ao/e is not installed" 9ou ha/e to install W'I> with 3P support in order to get this necessar# tool""""
.etter )ethod of 'utomating *iskpart
Wh# use the GFsG switch to run the diskpart commands in a diskdart scriptH -impl# create a atch file that EC:+s a group of
diskpart commands and pipes them to diskpart" .# piping commands directl# into diskpart #ou can a/oid making #our atch
file dependent on an e4ternal script and reduce the chances of the atch file reaking" 'nd it is eas# to do% consider the
EC:+ select disk 1
EC:+ clean
EC:+ create partition primar# si!eI7si!e of de/ice8
EC:+ select partition 1
EC:+ acti/e
EC:+ format fsIfat32
EC:+ assign
EC:+ e4it
2 J diskpart

Powershell script to create a C*(+) image
' Powershell script in the L.oot Windows PE from C*&(+)L section ma# also helpM it creates a complete I-+% ut also corrects a
range of documentation ugs"
*iskpart script error
When #ou create the script% forget the first line GdiskpartG
If #ou run the diskpart command with it% #ou will <ust get a list of the a/ailale commands
Walkthrough: Create a Custom Windows PE Image,v=ws.10).aspx
6 of 8 1/3/2014 5:59 PM
It should e instead:
select disk 1
create partition primary size=<size of device>
select partition 1
format fs=fat32
1inall# #ou can run: diskpart Fs 7script path8
1ranck .runet
T#pe Error -tep 3
-tep 3 Package names:
WinPE&W)I&Packages should e WinPE&W)I&Package
' little pick# ut"""
Error in step @
In step @ ao/e% the document uses incorrect 5uotes which turn out wrong"
The e4ample should read:
copy "c:\program files\<version>\Tools\x86\imagex.exe" c:\winpe_x86\iso\
xcopy "c:\program files\<version>\Tools\<architecture>\Servicing" c:\winpe_x86\iso\Servicing /s
Thomas =ee
need help pl!
hi % need help pl! Gwindows 7rcG
when i run
image4 Funmount c:6winpeC4DA6mount Fcommit
i get %error did not find image mount %
Walkthrough: Create a Custom Windows PE Image,v=ws.10).aspx
7 of 8 1/3/2014 5:59 PM
i add G6G after Gmount6G
image4 Funmount c:6winpeC4DA6mount6 Fcommit
first its work %ut now its not" can u hlp tn4"
[tfl - 14 06 09] Hi - and thanks for your post.You should post questions like this to the
Technet Forums at or the MS Newsgroups at You are much more likely get a
quick response using the forums than through the Community Content. For specific help about:
Exchange :
SQL Server :
Windows :
Windows Server :
Virtual Server :
Full Public :
Thomas =ee
N 2$1@ )icrosoft" 'll rights reser/ed"
Walkthrough: Create a Custom Windows PE Image,v=ws.10).aspx
8 of 8 1/3/2014 5:59 PM