Windows 7 / Getting Started

Preparing a Build environment

Installing the Windows OPK, Windows AIK, or Windows PE Kit will install the Windows PE build and imaging tools you need to create Windows PE images. You can download the Windows AIK from the Microsoft Download site (http://download. microsoft.com/ ). Next, burn the kit to a DVD or mount it using virtual DVD software.

If the Setup program doesn't start automatically, browse the DVD, and then click StartCD.exe to start the setup process.

After you install a kit, you'll find the following folders (where Version can be Windows OPK, Windows AIK, or Windows PE Kit):

  • %Systemroot%\program Files\Version\tools Contains the Version program files.
  • %Systemroot%\program Files\Version\tools\amd64 Contains ImageX source files for 64-bit x64 computers.
  • %Systemroot%\program Files\Version\tools\x86 Contains ImageX source files for 32-bit x86 computers.
  • %Systemroot%\program Files\Version\tools\ia64 Contains ImageX source files for Itanium-based computers.
  • %Systemroot%\program Files\Version\tools\Image Manager Contains Windows System Image Manager and related files.
  • %Systemroot%\program Files\Version\tools\petools Contains the Windows PE source files and optional components.
  • %Systemroot%\program Files\Version\tools\Servicing Contains the servicing files.
  • %Systemroot%\program Files\Version\tools\USMt Contains the User State Migration Toolkit and related files for x86 and x64 computers.

Before you can create a build, you need to set up the build environment. In the Tools folder is a command-line script called Copype.cmd. You can use this script to create your Windows PE build environment. The build environment contains the build scripts and source files that you can customize and then use to create new Windows PE images.

Whenever you work with the tools in the kit, you should use the Deployment Tools command prompt. This prompt has the environment settings for working with the kit you installed and can be started by completing the following steps:

  1. Click Start, point to All Programs, and then click either Microsoft Windows OPK, Microsoft Windows AIK, or Microsoft Windows PE Kit as appropriate.
  2. Right-click Deployment Tools Command Prompt, and then click Run As Administrator.

To set up a build environment for 32-bit x86 computers, enter the following command:

copype x86 c:\winpe_x86

To set up a build environment for 64-bit x64 computers, enter the following command:

copype amd64 c:\winpe_x64

To set up a build environment for Itanium-based computers, enter the following command:

copype ia64 c:\winpe_ia64

These commands set up the build environment under C:\Winpe_x86, C:\ Winpe_x64, and C:\Winpe_ia64, respectively. The C:\Winpe_x86 folder contains fi les for 32-bit Windows PE. The C:\Winpe_x64 folder contains fi les for 64-bit Windows PE. The C:\Winpe_ia64 folder contains fi les for Itanium-based Windows PE. You can specify alternative directories if you want, but using these standard names might be helpful for other administrators in your organization.

In the build directories, you'll fi nd ISO and Mount subdirectories. The ISO directory contains all the necessary fi les to build an .iso fi le by using the Oscdimg tool. This directory also includes the following subdirectories: Boot, EFI, and Sources. The Mount directory is an empty directory that you can use to mount Windows PE images by using the ImageX tool.

ImageX has a number of subcommands that you can use when working with Windows image fi les. These subcommands include the following:

  • imagex /append Appends a volume image to an existing Windows image fi le. ImagePath sets the path of the volume image to be captured. WIMFile sets the path of the existing WIM fi le. ImageName sets the unique name for the image. Description sets the descriptive text. The /Boot option marks the volume image as bootable (only for Windows PE images). The /Check option enables WIM integrity checking, and /Confi g Confi g.ini specifi es a confi guration fi le to use for excluding fi les and setting compression options. The /Norpfi x option disables reparse point path fi xup. The /Scroll option scrolls output for redirection. The /Temp option specifi es the path where temporary fi les are stored, and /Verify enables verifi cation of fi le resources.
    imagex {Options} /append ImagePath WIMFile "ImageName"
    ["Description"]
    
    {Options}
    [/boot] [/check] [/config config.ini] [/norpfix] [/scroll] [/temp]
    [/verify]
    
    imagex /append c: d:\images\windows.wim "Drive C"

  • imagex /apply Applies a volume image to a specifi ed path. WIMFile sets the path of the WIM fi le containing the volume image. ImageIndex identifi es the image within the WIM fi le by its index position. ImageName sets the name that identifi es the image within the WIM fi le. ImagePath sets the path where the image will be applied. The /Ref Splitwim.swm option enables a reference to split WIM files.
    imagex {Options} /apply WIMFile {ImageIndex | ImageName} ImagePath
    
    {Options}
    [/check] [/norpfix] [/ref splitwim.swm] [/scroll] [/temp] [/verify]
    
    imagex /apply d:\images\windows.wim 1 c:\

  • imagex /capture Captures a volume image from a drive to a new Windows image fi le. ImagePath sets the path to the volume image to be captured. WIMFile sets the path of the new WIM fi le. ImageName sets the unique name for the image being captured. Description sets the text that provides additional reference information. The /Compress Maximum option sets the compression level to maximum, and /Compress Fast enables fast compression.
    imagex {Options} /capture ImagePath WIMFile "ImageName"
    ["Description"]
    
    {Options}
    [/boot] [/check] [/compress {maximum | fast | none}]
    [/config] [/norpfix] [/scroll] [/temp] [/verify]
    
    imagex /capture c: d:\images\windows.wim "Drive C"

  • imagex /cleanup Deletes all the resources associated with a mounted image that has been abandoned. This command will not unmount currently mounted images, nor will it delete images that can be recovered via the imagex /remount command.
    imagex /cleanup
    
    imagex /cleanup

  • imagex /commit Commits the changes made to a mounted image without unmounting the image. MountPath sets the path of the mounted image to commit. ImageName sets the image name. The /Append option captures the changes you've made and creates a new image with those changes. If the /Append option is set, a unique image name must be provided.
    imagex [/append] /commit MountPath ["ImageName"]
    
    imagex /commit c:\mount
    imagex /commit /append c:\mount "New Image"


  • imagex /delete Deletes the specifi ed volume image from a Windows image fi le with multiple volume images. WIMFile sets the path of the WIM fi le containing the specifi ed image. ImageIndex sets the number that identifi es the image within the WIM file. ImageName sets the name that references the image within the WIM file.
    imagex [/check] [/temp] /delete WIMFile {ImageIndex | ImageName}
    
    imagex /delete d:\images\windows.wim 1

  • imagex /dir Displays a list of the fi les and folders within a specifi ed volume image. WIMFile sets the path of the WIM fi le containing the specifi ed image. ImageIndex sets the number that identifi es the image within the WIM file. ImageName sets the name that identifi es the image within the WIM file.
    imagex /dir WIMFile {ImageIndex | ImageName}
    
    imagex /dir d:\images\windows.wim 1

  • imagex /export Exports a copy of the specifi ed image to another Windows image fi le. SourceFile sets the path of the WIM fi le that contains the image to be copied. SourceNumber sets the number that identifi es the image within the source WIM. SourceName sets the name that identifi es the image within the source WIM. DestFile sets the path of the WIM fi le that will receive the image copy. DestName sets the unique name for the image in the destination WIM. If SourceName is set to "*", then all images are exported to DestFile.
    imagex {Options} /export SourceFile {SourceNumber | SourceName}
    DestFile DestName
    
    {Options}
    [/boot] [/check] [/compress {maximum | fast | none}]
    [/ref splitwim.swm] [/temp]
    
    imagex /export d:\images\windows.wim 1 d:\images\win_copy.wim
    "Exported Image"


  • imagex /info Returns the stored descriptions for the specifi ed Windows image fi le or volume image. ImgFile sets the path of the WIM fi le to be queried for information. ImgNumber sets the number that identifi es an image within the WIM fi le. ImgName sets the name that identifi es an image within the WIM fi le. NewName sets the new unique name for the specifi ed image. NewDesc sets the new description for the specifi ed image. The /XML option returns the output as XML.
    imagex {Options} /info ImgFile {ImgNumber | ImgName} [NewName]
    [NewDesc]
    
    {Options}
    [/boot] [/check] [/temp] [/xml]
    
    imagex /info d:\images\windows.wim

  • imagex /mount Mounts a Windows image with read-only permission to a specifi ed path. WIMFile sets the path of the WIM fi le containing the specifi ed image. ImageIndex identifi es the image within the WIM fi le by its index position. ImageName identifi es the image within the WIM fi le by its name. ImagePath sets the path where the specifi ed image will be mounted. When used without parameters, this subcommand lists all mounted images.
    imagex [/check] /mount [WIMFile {ImageIndex | ImageName} ImagePath]
    
    imagex /mount d:\images\windows.wim 2 c:\mount

  • imagex /mountrw Mounts a Windows image with read/write permission to a specifi ed path. WIMFile sets the path of the WIM fi le containing the specifi ed image. ImageIndex identifi es the image within the WIM fi le by its index position. ImageName identifi es the image within the WIM fi le by its name. ImagePath sets the path where the specifi ed image will be mounted. When used without parameters, this subcommand lists all mounted images.
    imagex [/check] /mountrw [WIMFile {ImageIndex | ImageName}
    ImagePath]
    
    imagex /mountrw d:\images\data.wim 2 c:\mount

  • imagex /remount Recovers an orphaned mount path. ImagePath sets the path to be remounted. When used without parameters, this subcommand lists all mounted images. imagex /remount [ImagePath] imagex /remount c:\mount

  • imagex /split Splits an existing Windows image fi le into multiple read-only split WIM (SWM) fi les. WIMFile sets the path of the WIM fi le to split. DestFile sets the path of the split fi le or fi les. Size sets the maximum size in megabytes for each created fi le.
    imagex [/check] /split WIMFile DestFile Size
    
    imagex /split d:\images\windows.wim d:\images\splitdata.swm 600

  • imagex /unmount Unmounts a Windows image from the specifi ed path. ImagePath sets the path to be unmounted. The /Commit option saves the changes before unmounting the image. If uncommitted changes exist, this subcommand must use either the /Commit or the /Discard option. When used without parameters, this subcommand lists all mounted images.
    imagex /unmount [[/commit | /discard] ImagePath]
    
    imagex /unmount /commit c:\mount

If you want to manipulate Windows images on a computer that does not have an appropriate kit installed, you must copy Dism.exe, Imagex.exe, Oscdimg.exe, Wimmount.sys, Wimmount.inf, and Wimserv.exe to that computer. Next, you must install the mounting driver by right-clicking the Wimmount.inf fi le, and then clicking Install. You must then place Dism.exe, Imagex.exe, Oscdimg.exe, and Wimserv.exe in your local path. To do this, copy them to the %SystemRoot%\System32 directory.

[Previous] [Contents] [Next]