Windows Vista : Managing Windows Images - Executing Common Tasks (part 1)

10/18/2012 4:13:47 AM
The following sections are intended to walk you through some common tasks. As a command line tool with many options, even the most regular users will rely upon a reference and some simple step-by-step instructions.

To prepare your system to employ the tasks documented in this section, follow these steps:

  1. Download the WAIK (approximately 1GB) from the Microsoft Web site (validation may be required).

    After you have the download, you will notice it has an IMG file extension. This is a DVD image file which you may burn using your preferred software. It may be necessary to rename the file extension from IMG to ISO in order for your software to properly recognize the file. Alternatively, you can use a drive emulator, such as Daemon Tools ( to mount the file as a drive without burning. Yet another option is to make use of some tools like WinRar or 7zip, which support ISO files just as you would any other archive file (like ZIP).

  2. After you have downloaded and have access to the setup, run STARTCD.EXE for an installation menu, choose Windows AIK Setup, and follow the simple wizard through the installation.

  3. Right-click the Windows PE Tools Command Prompt shortcut from its program folder on the Start menu and choose Run as administrator. The many command line tools covered are typically executed from the Windows PE Tools Command Prompt and must be run as administrator so this is an important step.

  4. To establish the file structure needed to customize a Windows PE image, run the CopyPE script with two arguments; the first is the target architecture (x86, ia64 or amd64), and the second is the target directory where you will manage your image. If you are working with multiple architectures, it is a good idea to include it in your target folder name. However, this is a path that needs to be typed for most all commands so keep the path short to save some typing. For the tasks documented in this section the following arguments are used:

    copype.cmd x86 c:\winpe_x86

  5. Mount the Windows PE image for read/write updates:

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

1. Adding packages to a Windows PE image

There are a number of packages available in the default Windows PE image which you may optionally choose to have installed (see Table 1.).

Table 1. Default Packages Provided with Windows PE
WinPE-FontSupport-JA-JP-Packageadditional Japanese font support
WinPE-FontSupport-KO-KR-Packageadditional Korean font support
WinPE-FontSupport-ZH-CN-Packageadditional Chinese font support
WinPE-FontSupport-ZH-HK-Packageadditional Hong Kong font support
WinPE-FontSupport-ZH-TW-Packageadditional Taiwanese font support
WinPE-HTA-PackageHTML application (HTA) support
WinPE-MDAC-PackageMicrosoft Data Access Component (MDAC) support
WinPE-Scripting-PackageWindows Script Host (WSH) support
WinPE-WMI-PackageWindows Management Instrumentation (WMI) support
WinPE-XML-PackageMicrosoft SML (MSXML) parser support


There was a package for the Windows System Recovery Tools (WinPE-SRT-Package) available in earlier builds of Windows PE which was unfortunately dropped. This has led many to exercise alternatives, such as BartPE for this purpose, but workarounds are available online at

The following task covers how to install any of the packages provided in Windows PE by default:

  1. List the available packages to see what is available, what is currently installed, and to verify the proper names for the available packages using the PEImg List command:

    PeImg /List c:\winpe_x86\mount

    Any currently installed packages will be denoted with a plus (+) sign in the "Ins" column of the listed packages table.

  2. Install the desired package by name, using wildcards if desired, with the WinPE Install command. For example, to install the Windows Script Host, you could use the following command:

    PeImg /Install=WinPE-Scripting-Package c:\winpe_x86\mount

  3. When done editing your image, be sure to commit the changes back to the mounted image by using the ImageX Unmount command:

    Imagex /Unmount /Commit c:\winpe_x86\mount

2. Adding hotfixes to a Windows PE image

You may want to apply service packs to your Windows PE image and this is something that is supported by PEImg. After you download and extract the CAB file from the update, you can use the import function to make it available as a package in the image. Then you can simply install the package as you would any of those included (detailed above).

  1. Create directories for downloads and to store your patches:

    md c:\downloads
    md c:\updates

    Download any desired updates to the updates folder, for example

  2. Updates such as this are provided as MSU files. Extract the contents using the Expand command:

    Expand c:\downloads\*.msu c:\updates -f:*

  3. Run the PEImg Import to make the updates available as packages:

    PeImg /Import=c:\updates\*.cab c:\winpe_x86\mount

  4. List the packages to see the one you have added is now available as expected using the PEImg List command:

    PeImg /List c:\winpe_x86\mount

  5. Install the new package by its name, or for updates you can specify the name using a wildcard, such as *KB* that can perform the installation for any packages with a name containing KB. For example:

    PeImg /Install=Package_for_KB931213 c:\winpe_x86\mount

  6. When done editing your image, be sure to commit the changes back to the mounted image using the ImageX Unmount command:

    Imagex /Unmount /Commit c:\winpe_x86\mount

3. Adding drivers to a Windows PE image

Many of the most common drivers are available in the default Windows PE image and will not require any work on your part. However, there are those times when devices, such as network devices will not function and getting the latest driver in your image is the logical course of action.

One such driver is the VMware network driver. VMware is used by many to test environments, such as Windows PE, particularly because it is easy to provide it a bootable image as an ISO file. To get network support from Windows PE from a VMware session it is necessary to add the VMware network driver to your image and use the PEImg INF command to perform the installation.

  1. Start up a VMware session and choose the Install VMware Tools option. Don't worry — if you already have them installed — doing this simply mounts a VMware Tools installation CD (which may automatically start the installation wizard). In the virtual CD that appears in your session, go to E:\ProgramFiles\VMware\VMwareTools\Drivers\vmxnet\win2k\ and copy these files to your host system.

    Copy D:\program files\VMware\VMware Tools\Drivers\vmxnet\
    win2k\*.* \\server\drivers\network\vmware\

  2. Install the driver using its INF file with the PEImg INF command:

    peimg /inf=\\server\drivers\network\vmware\vmware-nic.inf c:\winpe_x86\mount\windows

  3. When done editing your image, be sure to commit the changes back to the mounted image using the ImageX Unmount command:

    Imagex /Unmount /Commit c:\winpe_x86\mount

4. Incorporating service packs

If you make use of Windows PE 2.1, this release of Windows PE is based upon Windows Vista SP1. Incorporating SP1 into a production Windows Vista image is not as simple as you may have hoped. In the past, a practice known as slipstreaming could be used to incorporate the service pack contents with the original installation source. Apparently, there were plans to provide such a deployment mechanism with SP1, but having run into problems it is now hoped that such a feature will be seen with the release of Windows Vista SP2.

The basic steps to include Windows Vista SP1 to an existing Windows Vista production image are as follows:

  1. Boot to Windows PE and use ImageX to Apply image to reference PC.

  2. Reboot, log in to the computer, and Install Vista SP1.

  3. Run Sysprep with the generalize switch to prepare the image for deployment.

  4. Reboot to Windows PE and recapture the image with the ImageX Capture command.

5. Editing the registry of a Windows PE image

Although you cannot work with the registry as easily as you might hope, you can make changes to the registry of your image. From within Windows, you need only mount the image and then import the registry hive file into a temporary path in RegEdit. After you have made any desired changes, you can export the image path back to a file and replace the original file to realize the changes with your image.

Depending upon which area of the registry you wish to edit, you will need to load the appropriate hive file (see Table 2).

Table 2. File Locations for Registry Hives
Registry HiveMounted File Location
HKEY_CLASSES_ROOTmount\windows\system32\config\SOFTWARE (browse to classes)
HKEY_USERS and HKEY_CURRENT_USERComprised of ntuser.dat files of your local user profiles (i.e., mount\Users\*\ntuser.dat)

The steps to modify the registry of a WIM image are provided for your reference:

  1. With the image mounted for read/write (/MountRW), run RegEdit and select the HKEY_LOCAL_MACHINE hive.

  2. Choose File => Load Hive from the menu bar and browse to the location of the registry hive you want to modify (refer to Table 6.10) from within the Windows PE mounted file structure (c:\winpe_x86\mount\windows\system32\config\systemprofile\ntuser.dat)

  3. Enter a temporary name for the hive, such as WINPE.

  4. Browse to the WINPE node under HKLM and make any desired modifications.

  5. When you are done making edits, click the WINPE folder under HKLM and choose File => Unload Hive. You will be prompted to confirm this action.

  6. When done editing your image, be sure to commit the changes back to the mounted image using the ImageX Unmount command:

    Imagex /Unmount /Commit c:\winpe_x86\mount

RegEdit is also available in Windows PE so you can run this to verify your results within Windows PE. However, changes made with RegEdit while running Windows PE won't take effect because the registry is temporarily loaded in memory.

Most View
Mobile Phones Buying Guide – April 2013 (Part 3) : HTC One X+, HTC Windows 8X, Huawei Ascend Pi
Group Test: Eight Panels Beyond HD (Part 2) : HAZRO HZ27WB
Cooler Master Hyper T4 - A Step Up In Budget Cooling
The Latest Home And Office Products – July 2013 (Part 1)
ASRock Z77 Extreme11 Mainboard - An LGA 1155 Mainboard For Users That Use Multiple Drives (Part 1)
Nikon D600 - A Full-Frame Nikon For Your Full-Time Passion (Part 1)
Google vs Apple vs Microsoft (Part 2)
The Best Apps and Gear of 2012 (Part 3)
Worthy Audio Block C-100 For Mid-Class CD Player
BlackBerry Development : Pushing Data to External Users - Web Signals (part 1) - How Web Signals Work
Top 10
Teenage Kicks - Britain's Youngest Hot Rodders (Part 3)
Teenage Kicks - Britain's Youngest Hot Rodders (Part 2)
Teenage Kicks - Britain's Youngest Hot Rodders (Part 1)
Swing Low Sweet Chariot Muscle Car
The 25-year Rule (Part 2)
The 25-year Rule (Part 1)
Review : Linksys EA9200 Tri-Band Smart Wi-Fi router
Review : Xiaomi Mi Pad
Identity on Cisco Firewalls : Administrative Access Control on ASA
Identity on Cisco Firewalls : Administrative Access Control on IOS