Working with WIM:Use WinPE to Capture or Apply WIM Images
Filed in Uncategorized on Jul.25, 2009
Microsoft created a new set of imaging tools for the windows vista release. The new WIM format is a powerful tool that can be useful to any power user. From the admin trying to simplify the deployments in his environment to the average guy looking for a free way to take flexible images of his home machine. In this set of articles I am going to cover how to take full advantage of these new tools
Before we begin you will need to install the following
Preparing the WinPE CD to work with WIM images
Launch the WinPE Tool Command Prompt(found in the “windows aik” folder in the start menu)
Then run the following command
copype.cmd x86 O:winpe
I am using O:winpe as an example. This should be the path where you want to put your WinPE files. The target folder must not exist as it will get created in the process.
Now we are going to want to add the Imagex application to the WinPE IMG.
copy “c:Program filesWindows AIKToolsx86imagex.exe” O:winpeISO
Now we will create a file with notepad and name it Wimscript.ini. In here you will be able to create the exclusion list for the files that you do not want in your image as well as the files that should not be compressed. The following lists are based on the recommendations from the Microsoft press training kit for 70-622. You can copy that in and modify it to suit your needs.
[ExclusionList]
ntfs.log
hiberfil.sys
pagefile.sys
“System Volume Information”
RECYCLER
WindowsCSC
[CompressionExclusionList]
*.mp3
*.zip
*.cab
WINDOWSinf*.pnf
You now have all the basic part you need to create a WinPE CD to use for imaging. To create the ISO image from your current working files use this command
oscdimg -n -m -bO:winpeetfsboot.com O:winpeISO O:winpe.iso
There is no space between -b and the path to the etfsboot.com file
Using your WinPE CD and Imagex to capture an image
The preparation of the reference computer (the one that the image will be captured) is outside the scope of this article. This step will vary greatly depending on what you need the image for. If you do this on a test computer, I recommend installing all the windows updates and installing a few programs on it.
On the reference computer run the following command with administrator privilege.
%windir%/system32/sysprep/sysprep
This will bring up the sysprep window. For this tutorial we are going to use the OOBE experience. When you deploy an image that has been syspreped with the OOBE, you will get the same opening screen as you would get if you were installing windows vista from the installation CD.
Leave the other option to shutdown
Sysprep will go through the reference computer and erase all the unique identifiers from the machine. Once it is done it will shut down the reference machine. At this point we want to capture the image before restarting the machine.
Boot the computer back up with the WinPE CD.
Go to the folder where Imagex is located. If you followed all my instructions so far it will be in the root of D:
Then run the command
Imagex /compress fast /capture C: C:MyNewImage.wim “my Vista Install”
Because WIM images are file based rather than sector based, you can safely do that as long as you have enough free space on the drive.
Deploying the image
The first step is to prepare the hard drive. For this we will use diskpart
type in the command
diskpart
this will allow you to time in all the command you need to work with the disk. This step will vary depending on how you want to partition the disk. I will show you how to make a standard one partition on a one disk machine setup.
select disk 0
clean
create partition primary
select partition 1
active
format
exit
- Please note that if you have multiple drives, the disks are numbered starting with 0. For multiple partitions, Partitions are numbered with 1 being the first partition.
- make sure the partition containing the OS is the one marked active. If you are preparing multiple partitions do not run the “active” command on the ones
Go to the folder where Imagex was copied. In our example it is in d:
Imagex /apply “path to image” “image number” “path where to apply image”
In our example the command you would use is.
Imagex /apply E:winpe.iso 1 c:
The 1 indicates which image from the WIM file is to be installed. This should be 1 by default.
That’s it. The process will take roughly 15 minutes depending on the size of the image and the speed of your hard drive.
This article was aimed at getting you through the first steps. There will be a follow up article covering more advanced topics.


Leave a Reply