Walkthrough_ Create a Custom Windows PE Image

download Walkthrough_ Create a Custom Windows PE Image

of 8

description

How to create a Windows PE image

Transcript of Walkthrough_ Create a Custom Windows PE Image

  • Walkthrough: Create a Custom WindowsPE Image223 out of 271 rated this helpful

    This walkthrough describes how to create a customized Windows PE image. The primary tool for customizing

    Windows PE 2.0 is PEImg, a Windows PE command-line tool. After creating a customized image, you can deploy the

    image to a hard disk or create a bootable Windows PE RAM disk on a CD-ROM, a USB flash drive (UFD) or a hard disk.

    Note

    A Windows PE RAM disk boots directly into memory and is assigned the drive letter X, which does not correspond

    to the media (for example, a UFD or a CD-ROM) from which you booted. Ensure that you have sufficient memory

    to support the size of your Windows PE image plus any additional memory requirements, for example, if you plan

    on running any customized applications that need additional working memory.

    PrerequisitesTo complete this walkthrough, you need the following:

    A technician computer that provides all the tools and the source files. For more information, see Building a

    Technician Computer.

    Step 1: Set up a Windows PE Build EnvironmentIn this step, you create a required directory structure that supports building a Windows PE image.

    On your 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 automatically sets environment variables to point

    to all the necessary tools. By default, all tools are installed at C:\Program Files\version\Tools, where version can

    be Windows OPK or Windows AIK.

    1.

    At the command prompt, run the Copype.cmd script. The script requires two arguments: hardware

    architecture and destination location. For example,

    where can be x86, amd64, or ia64 and is a path to the local directory. For

    example,

    The script creates the following directory structure and copies all the necessary files for that architecture. For

    example,

    2.

    copype.cmd

    copype.cmd x86 c:\winpe_x86

    Walkthrough: Create a Custom Windows PE Image http://technet.microsoft.com/en-us/library/cc709665(d=printer,v=ws.10).aspx

    1 of 8 1/3/2014 5:59 PM

  • Step 2: Mount the Base Windows PE ImageIn this step, you mount the base image to a local directory so that you can add or remove packages.

    At the command prompt, mount the base Windows PE image (Winpe.wim) to the \Mount directory by using

    ImageX. For example,

    Step 3: Add Additional PackagesBy using the Peimg tool, you install Windows features by using the /install option. Windows features are included

    with the base image (Winpe.wim) but are not installed. You can also import packages and add drivers and language

    packs. For more information, see Windows PE Customization How-To Topics.

    Add a Windows feature to the base image by using the peimg /install command. For example,

    where denotes the package name. A list of available packages and their names can be obtained by

    using the /list command. You can use wildcards to specify a package name. Any packages with matching

    names will be installed. For example,

    -or-

    where wildcards denote any package with HTA in the package name.

    Windows PE 2.0 provides the following Windows features referred to as packages.

    Package Name Description

    WinPE-

    FONTSupport--Packages

    Additional font support for ja-jp, ko-kr, zh-cn, zh-hk, and zh-tw.

    1.

    \winpe_x86

    \winpe_x86\ISO

    \winpe_x86\mount

    imagex /mountrw c:\winpe_x86\winpe.wim 1 c:\winpe_x86\mount

    peimg /install= c:\winpe_x86\mount\Windows

    peimg /install=WinPE-HTA-Package c:\winpe_x86\mount\Windows

    peimg /install=*HTA* c:\winpe_x86\mount\Windows

    Walkthrough: Create a Custom Windows PE Image http://technet.microsoft.com/en-us/library/cc709665(d=printer,v=ws.10).aspx

    2 of 8 1/3/2014 5:59 PM

  • 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 (available only on

    the Windows OPK)

    WinPE-WMI-Packages Windows Management Instrumentation (WMI) support

    WinPE-XML-Package Microsoft XML (MSXML) parser support

    Repeat Step 1 for each package.2.

    Verify that the packages were installed by using the peimg /list command to view all packages in the current

    image. For example,

    In the INS column, (+) denotes installed packages and (-) denotes not installed.

    3.

    Step 4: (Optional) Add Additional CustomizationsThis step is optional but recommended. You can add applications and scripts to your Windows PE image that you

    might need while working in Windows PE. The following is a list of common tools to include in your Windows PE

    image.

    ImageX

    A command-line tool for capturing and applying images during deployment scenarios. For example, at a

    command prompt,

    Package Manager (Pkgmgr.exe)

    A tool for servicing Windows image (.wim) files offline. You must copy the entire \Servicing folder and MSXML6

    binaries. Offline servicing requires ImageX. For example,

    copy %windir%\system32\msxml6*.dll c:\winpe_x86\iso\Servicingwhere can be Windows OPK or Windows AIK and can be x86, amd64 or ia64. In

    both previous examples, the tools are not loaded into memory during a Windows PE RAM boot. The media

    must be available to access the tools.

    To load the tools into memory along with Windows PE, copy the source files into the mounted \Windows

    directory. For example,

    peimg /list c:\winpe_x86\mount\Windows

    copy c:\program files\\Tools\x86\imagex.exe c:\winpe_x86\iso\

    xcopy c:\program files\\Tools\\Servicing c:\winpe_x86\iso\Se

    Walkthrough: Create a Custom Windows PE Image http://technet.microsoft.com/en-us/library/cc709665(d=printer,v=ws.10).aspx

    3 of 8 1/3/2014 5:59 PM

  • Important

    Adding files to the \Windows directory will increase the size of your Windows PE RAM image. Ensure that

    your computer has sufficient memory to boot Windows PE and to run various applications.

    Step 5: Prepare the ImageIn this step, you prepare the image by using the peimg /prep command. This operation removes any non-installed

    packages from the final image. This operation reduces the overall image size. For example,

    The /prep option cannot be reverted, and after the /prep option is run, the /install, /uninstall, /import, and /list

    options will not function, while the /lang and /inf options will continue to function. The Peimg tool prompts you to

    confirm the command. To suppress this prompt for scripting, add the /f option.

    Step 6: Commit Changes to the ImageIn this step, you commit the changes to the original image file (Winpe.wim) by using the ImageX /unmount option

    with the /commit option. For example,

    Step 7: Replace the Default Boot.wim FileIn this step, you replace the default Boot.wim in the \ISO directory with your new customized image. The image must

    be called Boot.wim. For example,

    Next StepYou now have a customized Windows PE RAM disk image that you can place on bootable media, like a CD-ROM or a

    UFD.

    To create a bootable CD-ROM

    On your technician computer, at a command prompt, create an .iso file by using Oscdimg. For example,1.

    c:\winpe_x86\mount\Windows

    peimg /prep c:\winpe_x86\mount\Windows

    imagex /unmount c:\winpe_x86\mount /commit

    copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim

    Walkthrough: Create a Custom Windows PE Image http://technet.microsoft.com/en-us/library/cc709665(d=printer,v=ws.10).aspx

    4 of 8 1/3/2014 5:59 PM

  • Community Additions

    For IA-64 architecture, replace Etfsboot.com with Efisys.bin.

    Burn the image (Winpe_x86.iso) to a CD-ROM.2.

    To create a bootable UFD

    During a running Windows Vista operation system or a Windows PE session, insert your UFD device.1.

    At a command prompt, use Diskpart to format the device as FAT32 spanning the entire device, setting the

    partition to active. For example,

    where the value of disk 1 is equal to UFD.

    2.

    On your technician computer, copy all the content in the \ISO directory to your UFD device. You can manually

    create the directory structure or use the xcopy command to automatically build and copy the appropriate files

    from your technician computer to your UFD device. For example,

    where c is the letter of your technician computer hard disk and f is the letter of your UFD device.

    3.

    You can further customize your Windows PE image by adding language packs, customized scripts, and drivers. For

    more information, see Windows PE Customization How-To Topics.

    See Also

    ConceptsBuilding a Windows PE Image

    Booting Windows PE

    Re: PEIMG not available

    And in the newer version of WAIK, PEIMG.EXE was replaced by DISM.exe. See the documentation that gets installed with your

    oscdimg -n -bc:\winpe_x86\etfsboot.com c:\winpe_x86\ISO c:\winpe_x86\winpe_x86.iso

    diskpart

    select disk 1

    clean

    create partition primary size=

    select partition 1

    active

    format fs=fat32

    assign

    exit

    xcopy c:\winpe_x86\iso\*.* /s /e /f f:\

    Walkthrough: Create a Custom Windows PE Image http://technet.microsoft.com/en-us/library/cc709665(d=printer,v=ws.10).aspx

    5 of 8 1/3/2014 5:59 PM

  • version of WAIK.

    KC.Kennedy

    8/6/2013

    PEIMG not available

    Be aware that if you are just getting into this and start with WAIK 6.1 (Windows7 and the SP1 update) then the PEIMG tool

    mentioned above is not installed. You have to install WAIK with XP support in order to get this necessary tool....

    Mark522010

    3/1/2013

    Better Method of Automating Diskpart

    Why use the "/s" switch to run the diskpart commands in a diskdart script? Simply create a batch file that ECHOs a group of

    diskpart commands and pipes them to diskpart. By piping commands directly into diskpart you can avoid making your batch

    file dependent on an external script and reduce the chances of the batch file breaking. And it is easy to do, consider the

    following:

    (

    ECHO select disk 1

    ECHO clean

    ECHO create partition primary size=

    ECHO select partition 1

    ECHO active

    ECHO format fs=fat32

    ECHO assign

    ECHO exit

    ) | diskpart

    darinks

    9/17/2012

    Powershell script to create a CDROM image

    A Powershell script in the 'Boot Windows PE from CD-ROM' section may also help; it creates a complete ISO, but also corrects a

    range of documentation bugs.

    C0RRAD0

    7/2/2012

    Diskpart script error

    When you create the script, forget the first line "diskpart"

    If you run the diskpart command with it, you will just get a list of the available commands

    Walkthrough: Create a Custom Windows PE Image http://technet.microsoft.com/en-us/library/cc709665(d=printer,v=ws.10).aspx

    6 of 8 1/3/2014 5:59 PM

  • It should be instead:

    select disk 1cleancreate partition primary size=select partition 1activeformat fs=fat32assignexit

    Finally you can run: diskpart /s

    Franck Brunet

    12/3/2010

    Type Error Step 3

    Step 3 Package names:

    WinPE-WMI-Packages should be WinPE-WMI-Package

    A little picky but...

    HallGS

    7/5/2010

    Error in step 4

    In step 4 above, the document uses incorrect quotes which turn out wrong.

    The example should read:

    copy "c:\program files\\Tools\x86\imagex.exe" c:\winpe_x86\iso\

    and

    xcopy "c:\program files\\Tools\\Servicing" c:\winpe_x86\iso\Servicing /s

    Thomas Lee

    11/15/2009

    need help plz

    hi , need help plz "windows 7rc"

    when i run

    imagex /unmount c:\winpe_x86\mount /commit

    i get ,error did not find image mount ,

    Walkthrough: Create a Custom Windows PE Image http://technet.microsoft.com/en-us/library/cc709665(d=printer,v=ws.10).aspx

    7 of 8 1/3/2014 5:59 PM

  • i add "\" after "mount\"

    imagex /unmount c:\winpe_x86\mount\ /commit

    first its work ,but now its not. can u hlp tnx.

    [tfl - 14 06 09] Hi - and thanks for your post.You should post questions like this to the Technet Forums at http://forums.microsoft.com/technet or the MS Newsgroups at http://www.microsoft.com/communities/newsgroups/en-us/. You are much more likely get a quick response using the forums than through the Community Content. For specific help about:Exchange : http://groups.google.com/groups/dir?sel=usenet%3Dmicrosoft.public.exchange%2C&SQL Server : http://groups.google.com/groups/dir?sel=usenet%3Dmicrosoft.public.sqlserver%2C&Windows : http://groups.google.com/groups/dir?sel=usenet%3Dmicrosoft.public.windows%2C&Windows Server : http://groups.google.com/groups/dir?sel=usenet%3Dmicrosoft.public.windows.server%2C&Virtual Server : http://groups.google.com/group/microsoft.public.virtualserver/topics?lnkFull Public : http://groups.google.com/groups/dir?sel=usenet%3Dmicrosoft.public%2C&

    Thomas Lee

    6/14/2009

    2014 Microsoft. All rights reserved.

    Walkthrough: Create a Custom Windows PE Image http://technet.microsoft.com/en-us/library/cc709665(d=printer,v=ws.10).aspx

    8 of 8 1/3/2014 5:59 PM