Creating WIM images of Windows XP for system deployment using Windows PE 01/14/2008 Isaac Holmes
WIM Imaging Tutorial v1.5 Page 2 
Table of Contents 
Introduction: ................................................................................................................................................. 4 
Requirements: ............................................................................................................................................... 5 
Creating a basic Windows PE disk for troubleshooting or image capture or deployment: .......................... 6 
Installing drivers to Windows PE: .............................................................. Error! Bookmark not defined. 
Capturing a WIM disk images using Windows PE and ImageX: .................................................................... 9 
Capture to USB or local drive: ................................................................................................................... 9 
Capture to a network file share: ............................................................................................................. 10 
Partition and Format the Hard Drive from Windows PE: ........................................................................... 11 
Partition and Format drive from Windows PE Single Partition: ............................................................. 11 
Partition and Format drive from Windows PE Two Partitions: .............................................................. 12 
DISKPART Scripting:................................................................................................................................. 13 
Deploying WIM images: .............................................................................................................................. 14 
Deploy from USB drive: ........................................................................................................................... 14 
Deploy from Network Share: .................................................................................................................. 14 
Deploy from CD/DVD: ............................................................................................................................. 15 
Command Files for automation of Base Windows PE ISO Image: .............................................................. 16 
Create_Mount.cmd ................................................................................................................................. 16 
Install_Packages.cmd .............................................................................................................................. 16 
Commit_Changes.cmd ............................................................................................................................ 17 
Create_ISO.CMD ..................................................................................................................................... 17 
Install_Drivers.CMD ................................................................................... Error! Bookmark not defined. 
Build_All.CMD ......................................................................................................................................... 17
WIM Imaging Tutorial v1.5 Page 3 
Appendices: ................................................................................................................................................. 18 
Appendix A: Adding your own startup commands or applications ....................................................... 18 
Appendix B: Remove boot prompt ........................................................................................................ 18 
Appendix C: Using Driverpacks from Driverpacks.net ........................................................................... 18 
Appendix D: Using Ghost instead of ImageX ......................................................................................... 18 
Appendix E: Exclude files during capture using an ImageX configuration file ....................................... 19 
Exclusion List Guidelines ..................................................................................................................... 19 
Appendix F: Booting Windows PE from USB Flash Drive (UFD) ............................................................. 20 
Additional Resources: ................................................................................................................................. 21 
References: ................................................................................................................................................. 21
WIM Imaging Tutorial v1.5 Page 4 
Introduction: 
With the release of Vista, Microsoft has developed a new method of deploying machines. Part of this new deployment method is the use of file based images called the Windows Imaging format or WIM. What’s the difference between a Ghost image and a WIM image? Ghost doesn't know or care what format the drive or partition is that it is copying: FAT, FAT32, Linux EXT3, HPFS, or NTFS. To it disks are just partitions and partitions are sectors. Ghost will read a sector from the hard disk, compress it and place it into an image file, then continue with the sector, and the next until it has finished copying the disk or partition, which is why it is called "sector-based" imaging. WIMs are file- and folder- based, and deploy in a mostly non-destructive manner. When you deploy a sector-based image to a hard disk, you destroy whatever partitions sit on that disk; re-imaging a system with Ghost means wiping out the drive. However, when deploying a WIM to a system it means only overwriting whatever files are in the WIM, and no others. As an example, if you had a Windows XP workstation whose hard disk contained a folder named "c:saveddocs" which held hundreds of documents and you then re-apply the original image to that computer, then you would have a clean copy of the operating system because you overwrote the old one, but the c:saveddocs folder would still exist in its untouched state. You can also use the WIM format at no cost. All of the WIM tools are a free download from Microsoft as part of the Windows Automated Installation Kit. Ghost, Acronis and other products like them in general all cost money. One other important difference is that as of this writing there is currently no method to multicast a WIM image to multiple machines at once. This is being added to Server 2008 with the Windows Deployment Services.
WIM Imaging Tutorial v1.5 Page 5 
Requirements: 
To work through this tutorial you will need the following: Technician Machine to run utilities on with the following: 
o WAIK (Windows Automated Installation Kit) installed on Technician machine 
 Download: http://www.microsoft.com/downloads/details.aspx?familyid=C7D4BC6D-15F3- 4284-9123-679830D629F2&displaylang=en 
o Technician machine will need a CD/DVD-R/RW 
o 2 GB of free disk space to install WAIK and work on Windows PE image. 
Source system 
o System configured as desired and ready for image capture. 
Destination system 
o System to test the deployment of your image to. 
o System must be the same or compatible with the source system unless you are using the Universal Imaging Utility 
External USB drive or network file share with enough space to store the image, a secondary drive in the source system is also acceptable. 
Blank CD/DVD-R/RW media, number depends upon method of deployment and image size.
WIM Imaging Tutorial v1.5 Page 6 
Creating a basic Windows PE disk for troubleshooting or image capture or deployment: 
1. Download and install WAIK on technician system machine. 
2. Create your source system with software installed and configured as desired and ready to be imaged as you have always done. 
3. On technician system launch ‘Windows PE Tools Command Prompt’ from ‘Microsoft Windows AIK’ on the Programs Menu. The entire CD build process is performed in this CMD window. 
4. To begin building a Windows PE CD type: copype.cmd x86 c:winpe_x86 
a. Where x86 is the desired system architecture (x86 or amd64) 
b. And c:winpe_x86 is your desired working location for Windows PE; this directory must not already exist. 
5. Now mount the Windows PE boot image as a folder on your machine so that it may be edited by typing the following: imagex /mountrw c:winpe_x86winpe.wim 1 c:winpe_x86mount 
6. To copy servicing tools into the mounted PE image, type: xcopy "C:Program FilesWindows AIKToolsServicing" c:winpe_x86mountWindows /s xcopy "C:Program FilesWindows AIKToolsx86" c:winpe_x86mountWindows /s /Y 
7. If you wish to add any additional files such as additional diagnostic tools, Ghost32 or other standalone applications copy them now to: (Remember this is a limited Windows environment it will not have all of the functionality of a normal Windows installation.) c:winpe_x86mount – this will be the X: drive when booted from the CD and everything here loads into memory, the more you put here the more memory that will be required. c:winpe_x86ISO – this is the CD itself, put large files like the image files here. 
8. Install additional support options: These are not required for image capture or deployment, but if you need the ability to run
WIM Imaging Tutorial v1.5 Page 7 
scripts, use WMI, or any other item listed below it must be explicitly installed before continuing. If you decide you want them later you will have to start the process over. 
a. Windows Recovery Environment component peimg /install=WinPE-SRT-Package c:winpe_x86mountWindows 
b. HTML application Support peimg /install=WinPE-HTA-Package c:winpe_x86mountWindows 
c. Microsoft Data Access Component support peimg /install=WinPE-MDAC-Package c:winpe_x86mountWindows 
d. Windows Script Host support peimg /install=WinPE-Scripting-Package c:winpe_x86mountWindows 
e. Microsoft XML (MSXML) parser support peimg /install=WinPE-XML-Package c:winpe_x86mountWindows 
f. WMI (Windows Management Instrumentation) peimg /install=WinPE-WMI-Package c:winpe_x86mountwindows 
9. Prepare the Windows PE Image by typing, this removes unneeded items from the image: peimg /prep c:winpe_x86mountWindows /f 
10. Install hardware drivers if necessary before continuing, see next chapter. 
11. To commit the changes made to Windows PE, type: imagex /unmount c:winpe_x86mount /commit 
12. Copy the updated WIM to the ISO folder for creation: copy c:winpe_x86winpe.wim c:winpe_x86ISOsourcesboot.wim /Y 
13. Create your ISO image: oscdimg -n -bc:winpe_x86etfsboot.com c:winpe_x86ISO c:winpe_x86winpe_x86.iso 
14. Using your preferred CD creation software burn the disk image c:winpe_x86winpe_x86.iso to CD or CD-RW.
WIM Imaging Tutorial v1.5 Page 8 
Installing Drivers 
Drivers can be added to both an online and offline images using different tools. Drvload loads drivers to a booted Windows PE environment while the PEImg tool installs them to the offline image. If the driver requires a reboot to activate you should install it using PEimg, Drvload will ignore the reboot but will not initialize the .sys driver. 
Installing drivers to offline Windows PE image: 
1. Collect the drivers you wish to install and save them to a folder based on the device they are designed for. 
C:driversLAN C:driversMSD etc. 
2. Extract the drivers from their compressed packages; this process will vary depending upon the method used by the manufacturer. Place each driver in its own sub-folder under its device type folder c:driversnet, c:driversmsd, etc. 
c:driversnetintel100 c:driversnetbroadcom100 c:driversMSDintel c:driversMSDAMD etc. 
3. Run the following command for each folder, where <source path> is the directory containing the driver INF file, and <destination path> (i.e. c:winpe_x86mount) is the path to you mounted Windows PE image: peimg /inf:<source path>*.inf <destination path>windows 
Installing drivers to running Windows PE: 
1. Collect the drivers you wish to use after booting. 
2. Drivers should be extracted to folder and placed in folder on CD or USB device. 
3. Run the following command after booting from you PE CD where <source path> is the directory containing the desired driver(s), multiple <source paths> can be specified by separating them with a comma: Drvload <source path>, <source path 2>, <source path 3> 
Make the PE image smaller: 
After installing packages and drivers the Windows PE image is likely bloated with unused items. To remove the unused items run the following where <source wim> is the bloated image and <dest wim> will be the cleaned up image. <dest wim> must not already exist. Imagex /boot /export <source wim> 1 <dest wim>
WIM Imaging Tutorial v1.5 Page 9 
Capturing a WIM disk images using Windows PE and ImageX: 
Capture to USB or local drive: 
1. Connect your USB or secondary drive to the machine to be imaged. 
2. Turn on computer and boot from your newly create Windows PE CD. 
3. Windows PE will load and launch a CMD window and run WPEINIT, do not close this window as this will cause the machine to reboot. 
4. Verify the USB/secondary drive and the drive to be imaged are both seen, the internal drive should be C:, and the USB or secondary drive D:, but this is not always the case depending upon BIOS configurations. The CD will be the next drive letter after the last partition and the RAM drive where the OS is running from will be X:. As long as you know what is on your drive a simple DIR listing of each drive should suffice to determine the drive letters. For our example we will assume the internal hard drive is C: and the USB/secondary drive is D: 
5. To capture the first partition in the CMD window type: imagex /capture c: d:C_Image.wim “Drive C” “My image description” /compress maximum Note: Imagex only captures or deploys partitions; it does not capture full disks. If your disk contains more than one partition you will need to capture each individually. You can capture each partition to the same file by using the following command to append the additional partitions to the existing WIM (assuming D: is the second partition and E: is the USB/secondary drive): imagex /append d: e:C_Image.wim “Drive D” 
6. If you will be putting your image on CD/DVD you may need to split the final image into smaller pieces to fit on the media do that now with this command: imagex /split d:C_Image.wim 650 This will split the image into 650mb chunks on in the same location as the image file. You can split the image into larger or smaller size chunks by changing the 650 to you desired size in megabytes. If you wish to split it to a different location add the path after the source file name: imagex /split d:c_image.wim d:splitfile 650 
7. You are now ready to deploy your image.
WIM Imaging Tutorial v1.5 Page 10 
Capture to a network file share: 
You must have created you Windows PE CD with the appropriate network drivers in order to capture the image to the network. 
1. Turn on computer and boot from your newly create Windows PE CD. 
2. Windows PE will load and launch a CMD window and run WPEINIT, do not close this window as this will cause the machine to reboot. 
3. Verify the drive to be imaged is seen, the internal drive should be C:. The CD will be the next drive letter after the last hard drive partition and the RAM drive where the OS is running from will be X:. As long as you know what is on your drive a simple DIR listing of each drive should suffice to determine the drive letters. 
4. There are two options to connect to a network share: 
a. Map share to a drive letter: 
i. In CMD window type: NET USE K: myserverimages 
ii. The net use command in Windows PE is the same as in Windows XP. 
b. Use UNC path: 
i. In CMD window type: SETLOCAL ENABLEEXTENSIONS 
ii. You will now be able to use UNC paths in the CMD window in place of drive letters. 
5. If you chose to use UNC paths replace K: with the path to your share (myserverimages) in the following steps. 
6. To capture the first partition in the CMD window type: imagex /capture c: K:C_Image.wim “Drive C” “My image description” /compress maximum Note: Imagex only captures or deploys partitions; it does not capture full disks. If your disk contains more than one partition you will need to capture each individually. You can capture each partition to the same file by using the following command to append the additional partitions to the existing WIM (assuming D: is the second partition and E: is the USB drive): imagex /append K: e:C_Image.wim “Drive D” 
7. If you will be putting your image on CD/DVD you may need to split the final image into smaller pieces to fit on the media do that now with this command: imagex /split K:C_Image.wim 650 This will split the image into 650mb chunks on in the same location as the image file. You can split the image into larger or smaller size chunks by changing the 650 to you desired size in megabytes. If you wish to split it to a different location add the path after the source file name: imagex /split K:c_image.wim d:splitfile 650 
8. You are now ready to deploy your image.
WIM Imaging Tutorial v1.5 Page 11 
Partition and Format the Hard Drive from Windows PE: 
Unlike Ghost, ImageX does not partition and format the drive as the image is deployed. It will in fact overwrite only the files that are contained within the WIM file. To start off a machine from scratch with a new image you must first partition and format the drive as desired. Following is the procedure for partitioning and formatting the hard drive from Windows PE as a single partition. 
Partition and Format drive from Windows PE Single Partition: 
1. From CMD window run DISKPART. DISKPART will present its own prompt. 
2. Determine Disk order, type: LIST DISK 
3. Select the disk to be imaged, change the number to correspond to your destination, type: SELECT DISK 0 
4. To erase everything on the disk type: CLEAN 
5. Create primary partition: CREATE PART PRI 
6. Select the newly created partition: SELECT PART 1 
7. Set partition active: ACTIVE 
8. Assign it a drive letter: ASSIGN LETTER=C: 
9. Format the drive: FORMAT FS=NTFS LABEL=”CDRIVE” QUICK 
10. Exit DISKPART: EXIT
WIM Imaging Tutorial v1.5 Page 12 
Partition and Format drive from Windows PE Two Partitions: 
1. From CMD window run DISKPART. DISKPART will present its own prompt. 
2. Determine Disk order, type: LIST DISK 
3. Select the disk to be imaged, change the number to correspond to your destination, type: SELECT DISK 0 
4. To erase everything on the disk type: CLEAN 
5. Create primary partition, size in MB: CREATE PART PRI SIZE=1000 
6. Select the newly created partition: SELECT PART 1 
7. Set partition active: ACTIVE 
8. Assign it a drive letter: ASSIGN LETTER=C: 
9. Format the drive: FORMAT FS=NTFS LABEL=”CDRIVE” QUICK 
10. Create extended partition: CREATE PART EXT 
11. Create logical disk: CREATE PART LOG 
12. Select logical disk: SELECT PART 2 
13. Format logical partition: FORMAT FS=NTFS LABEL=”CDRIVE” QUICK 
Note: Notice you do not have to assign a drive letter to a partition to format it. It formats the currently selected partition. 
14. Assign it a drive letter: ASSIGN LETTER=E 
Note: D: is already assigned to your CD, the letters assigned to the drive are good only for this session of Windows PE and have no bearing anywhere else. 
15. Exit DISKPART: EXIT
WIM Imaging Tutorial v1.5 Page 13 
DISKPART Scripting: 
DISKPART is also scriptable so that you do not have to manually type in all the commands to partition your disk. WARNING: If your disks are not in the order expected when the script is run the wrong disk could be selected and wiped clean thereby losing data. To run a DISKPART script us the following command: DISKPART /s myscript.txt SinglePartition.txt 
SELECT DISK 0 CLEAN CREATE PART PRI SELECT PART 1 ACTIVE ASSIGN LETTER=C: FORMAT FS=NTFS LABEL=”CDRIVE” QUICK EXIT 
DualPartition.txt 
SELECT DISK 0 CLEAN CREATE PART PRI SELECT PART 1 ACTIVE ASSIGN LETTER=C: FORMAT FS=NTFS LABEL=”CDRIVE” QUICK CREATE PART EXT CREATE PART LOG SELECT PART 2 ASSIGN LETTER=D FORMAT FS=NTFS LABEL=”CDRIVE” QUICK EXIT
WIM Imaging Tutorial v1.5 Page 14 
Deploying WIM images: 
Deploy from USB drive: 
1. Connect USB drive to destination machine. 
2. Boot from Windows PE CD 
3. Partition and format the partition as shown above. 
4. Deploy image to drive: imagex /apply d:C_Image.wim “Drive C” C: 
5. If you need to make any changes to the image you can now access all of the files written from the image and modify them as needed. 
6. Remove media and reboot. 
Deploy from Network Share: 
You must have created you Windows PE CD with the appropriate network drivers in order to capture the image to the network. 
1. Boot from Windows PE CD 
2. Partition and format the partition as shown above. 
3. There are two options to connect to a network share: 
a. Map share to a drive letter: 
i. In CMD window type: NET USE K: myserverimages 
ii. The net use command in Windows PE is the same as in Windows XP. 
b. Use UNC path: 
i. In CMD window type: SETLOCAL ENABLEEXTENSIONS 
ii. You will now be able to use UNC paths in the CMD window in place of drive letters. 
4. If you chose to use UNC paths replace K: with the path to your share (myserverimages) in the following steps. 
5. Deploy image to drive: imagex /apply K:C_Image.wim “Drive C” C: 
6. If you need to make any changes to the image you can now access all of the files written from the image and modify them as needed. 
7. Remove media and reboot.
WIM Imaging Tutorial v1.5 Page 15 
Deploy from CD/DVD: 
1. First, add the WIM image to your CD/DVD. 
a. Repeat the process to create a Windows PE CD to the point where you can add your own custom files. 
b. Add the image WIM file to the ISO folder. 
c. Finish the ISO image creation and burn to CD/DVD. 
2. Boot target machine from your Windows PE CD/DVD containing your image file. 
3. Partition and format drive as needed. 
4. Determine the drive letter of your CD/DVD. 
5. Replace d: in imagex /apply command with the letter of your CD/DVD as needed to access WIM. 
6. Apply image: imagex /apply d:C_Image.wim “Drive C” C: 
7. If you need to make any changes to the image you can now access all of the files written from the image and modify them as needed. 
8. Remove media and reboot.
WIM Imaging Tutorial v1.5 Page 16 
Command Files for automation of Base Windows PE ISO Image: 
If desired change the variable values at the beginning of these CMD scripts to point to the directories you wish to use. Place these CMD files in C:program filesWindows AIKToolsPETools and run them from the “Windows PE Tools Command Prompt” or you need to add the path to the PETools directory to your Path statement which is done by pesetenv.cmd when you open the “Windows PE Tools Command Prompt” 
Create_Mount.cmd 
Set DestFolder=C:winpe_x86 Set Arch=x86 copype.cmd %Arch% %DestFolder% imagex /mountrw %DestFolder%winpe.wim 1 c:winpe_x86mount xcopy "C:Program FilesWindows AIKToolsServicing" %DestFolder%mountWindows /s xcopy "C:Program FilesWindows AIKTools%Arch%" %DestFolder%mountWindows /s /Y exit 
Install_Packages.cmd 
Set DestFolder=C:winpe_x86 rem peimg /install=WinPE-SRT-Package %DestFolder%mountWindows peimg /install=WinPE-HTA-Package %DestFolder%mountWindows peimg /install=WinPE-MDAC-Package %DestFolder%mountWindows peimg /install=WinPE-Scripting-Package %DestFolder%mountWindows peimg /install=WinPE-XML-Package %DestFolder%mountWindows peimg /install=WinPE-WMI-Package %DestFolder%mountwindows peimg /prep %DestFolder%mountWindows /f 
Install_Drivers.CMD 
When calling pass a variable pointing to the driver directory which contains the drivers you wish to install, the given directory will be recursively searched. set Drivers=% 1 set DestFolder=c:winpe_x86 pushd %Drivers% for /f %%i in ('dir /s /b *.inf') do ( peimg /inf:%%i %DestFolder%mountwindows if ERRORLEVEL 1 echo %%i>>%Drivers%bad_driver.txt ) popd
WIM Imaging Tutorial v1.5 Page 17 
Commit_Changes.cmd 
Set DestFolder=C:winpe_x86 imagex /unmount %DestFolder%mount /commit 
Create_ISO.CMD 
Set DestFolder=C:winpe_x86 copy %DestFolder%winpe.wim %DestFolder%ISOsourcesboot.wim /Y oscdimg -n –b%DestFolder% etfsboot.com %DestFolder%ISO %DestFolder%winpe_x86.iso 
Build_All.CMD 
Set Architecture=x86 Set PEDest=c:winpe_x86 Set ISOName=winpe_x86.iso Set installmsd=true Set MSDPath=c:driversMSD Set installlan=true Set LanPath=c:drivesLAN Set removeboot=true pushd %cd% call copype.cmd %Architecture% %PEDest% imagex /mountrw %PEDest%winpe.wim 1 %PEDest%mount xcopy "C:Program FilesWindows AIKToolsServicing" %PEDest%mountWindows /s xcopy "C:Program FilesWindows AIKTools%Architecture%" %PEDest%mountWindows /s /Y peimg /install=WinPE-SRT-Package %PEDest%mountWindows peimg /install=WinPE-HTA-Package %PEDest%mountWindows peimg /install=WinPE-MDAC-Package %PEDest%mountWindows peimg /install=WinPE-Scripting-Package %PEDest%mountWindows peimg /install=WinPE-XML-Package %PEDest%mountWindows peimg /install=WinPE-WMI-Package %PEDest%mountWindows if "%installmsd%"=="true" call Install_MSD.cmd %MSDPath% if "%installlan%"=="true" call Install_Network.cmd %LANPath% peimg /prep %PEDest%mountWindows /f imagex /unmount %PEDest%mount /commit imagex /boot /export %PEDest%winpe.wim 1 %PEDest%shrink.wim copy %PEDest%shrink.wim %PEDest%ISOsourcesboot.wim /Y if "%removeboot%"=="true" del /q %pedest%isobootbootfix.bin oscdimg -n -b%PEDest%etfsboot.com %PEDest%ISO %PEDest%%ISOName% popd
WIM Imaging Tutorial v1.5 Page 18 
Appendices: 
Appendix A: Adding your own startup commands or applications 
With the image mounted edit c:winpe_x86mountwindowssystem32startnet.cmd and add your own commands to the end of the file to automate functions at startup. Or you can create a text file named c:winpe_x86mountwindowssystem32Winpeshl.ini, set the AppPath value in Winpeshl.ini to the application you wish to run, command line options are not supported. Use the [LaunchApps] section to run applications with command-line options. The applications run in the order listed; separate the name of the application from its options with a comma. Winpeshl.ini 
[LaunchApp] AppPath=%systemdrive%system32myshell.exe [LaunchApps] %SYSTEMDRIVE%mydirapplication1.exe, -option1 -option2 application2.exe, -option1 -option2 
Appendix B: Remove boot prompt 
To remove the “Press any Key to boot from CD or DVD” prompt when booting from CD, delete bootfix.bin from c:winpe_x86ISOboot before running OSCDIMG to create the CD ISO image. 
Appendix C: Using Driverpacks from Driverpacks.net 
At the time of this writing the current version of the LAN Driverpack is 7.121, Mass Storage is 7.121. If you intend to use the Driverpacks to install drivers you will find that you will receive a half dozen or so errors if you try installing all of the drivers available. This is due to there being some drivers for Windows 9x and NT systems which are not compatible with Windows PE 2.0. I have also found that some of the Mass storage drivers when installed prevent Windows PE from booting, at this time the known offending drivers are in the following folders when expanded: DMAD8, DM3B, DMD. If you remove these directories the rest of the OEMSETUP drivers install and Windows PE boots without any issues. 
Appendix D: Using Ghost instead of ImageX 
You can use Ghost instead of ImageX to handle imaging during the building of your Windows PE ISO. At a minimum you will need to add GHOST32.EXE to your CD, you can also use the other 32-bit application included like GDISK32, GhRegEdit32, GhWalk32, Ghostexp, etc. Then you can use Ghost as you have in the past but use the 32-bit Windows version instead of the 16-bit DOS version.
WIM Imaging Tutorial v1.5 Page 19 
Appendix E: Exclude files during capture using an ImageX configuration file 
By default ImageX excludes certain files from being included in the image during a capture. Default Exclusion list: 
[ExclusionList] $ntfs.log hiberfil.sys pagefile.sys "System Volume Information" RECYCLER WindowsCSC [CompressionExclusionList] *.mp3 *.zip *.cab WINDOWSinf*.pnf 
You can define your own additional exclusion by creating a configuration INI file and referencing it during image capture. To use your custom list add /config x:<config file path>configuration.ini to your ImageX capture command: imagex /config x:<config file path>configuration.ini /capture c: d:C_Image.wim “Drive C” “My image description” /compress maximum If you name the configuration file wimscript.ini and place it in the same folder as ImageX it will run automatically when using the /capture switch without needing to use the /config switch. 
Exclusion List Guidelines You can only use wildcards in the last component in a file path that does not begin with a preceding back slash. For example, myfolder*.txt You can use a preceding backward slash to limit file- and directory-matching relative to the root directory. For example, if you capture the "c:" drive with the previous exclusion list, 
myfolder foldersubfolder Then ImageX will exclude the following root directories and their files, C:myfolder c:foldersubfolder But will not exclude sub-folders of the same name for example,
WIM Imaging Tutorial v1.5 Page 20 
C:mainmyfolder c:datafoldersubfolder You can override the default exclusion list by using the [ExclusionException] section. For example, [ExclusionException] pagefile.sys "System Volume Information" If an explicit [ExclusionException] section is provided in the WIM configuration file, it will always take precedence over the [Exclusion List] section. You cannot override the default compression exclusion list by using the [ExclusionException] section. 
Appendix F: Booting Windows PE from USB Flash Drive (UFD) 
Before you can place Windows PE on a UFD device, you must use Diskpart to format the UFD with a Windows Vista or Windows PE environment. 
1. From a running Windows Vista operation system or Windows PE session, insert your UFD device. 
2. At a command prompt, use Diskpart to format the device as FAT32 spanning the entire device, and set the partition as active. For example, 
Diskpart select disk 1 clean create partition primary select partition 1 active format fs=fat32 assign exit 
The example above assumes disk 1 is the UFD. 
3. On your technician computer, copy all the content in the ISO directory onto 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, 
xcopy c:winpe_x86iso*.* /s /e /f f: where c: is your technician computer hard disk and f: is your UFD device..
WIM Imaging Tutorial v1.5 Page 21 
Additional Resources: ImageX GUI interface – http://www.msfn.org/board/index.php?showtopic=99148 DISKPART GUI Interface – Disk Partitioner v1.2 
http://www.911cd.net/forums//lofiversion/index.php?t13516.html Driverpacks – Network and Mass Storage driver packs http://www.driverpacks.net 
References: http://technet2.microsoft.com/WindowsVista/en/library/129a1712-e3d8-46c1-bc09- a14349dc67db1033.mspx?mfr=true WINPE.CHM – Help file installed by WAIK 
Technical Advisors: JuMz - msfn.org Chiners_68 – msfn.org p4ntboy – msfn.org DigeratiPrime – msfn.org

More Related Content

PDF
Linux install
PDF
Dell Venue 7 3740
PPTX
Virtualization
PDF
Mac boot camp install-setup
PPTX
WinConnections Spring, 2011 - Deploying Windows 7 without the Ridiculous Micr...
PDF
Deform 3 d_v61_unix_installation_notes
PDF
2 v mware
Linux install
Dell Venue 7 3740
Virtualization
Mac boot camp install-setup
WinConnections Spring, 2011 - Deploying Windows 7 without the Ridiculous Micr...
Deform 3 d_v61_unix_installation_notes
2 v mware

What's hot (15)

PDF
Vista deployment using tivoli provisioning manager for os deployment redp4295
PDF
Aix student guide system administrations part 2 problem determination
PDF
SPSS Statistics Concurrent License Administrator’s guide
PPTX
Virtualization technology "comparison vmware 9 vs virtualbox 4.2"
PPTX
Let’s talk virtualization
PDF
groupProject-1-Win8
PDF
How to boot a VM form a Forensic Image
PDF
Installing mandriva linux mandriva community wiki
DOCX
system state backup restore
PDF
How To Fresh Install Windows X P Pro Without A Recovery C D
PPTX
Installing win 7 os
PDF
The Holy Grail of Deployment
PDF
Cloud ready+installation+instructions
PDF
V sphere 5-upgrade-best-practices-guide[1]
PDF
V sphere 5-upgrade-best-practices-guide
Vista deployment using tivoli provisioning manager for os deployment redp4295
Aix student guide system administrations part 2 problem determination
SPSS Statistics Concurrent License Administrator’s guide
Virtualization technology "comparison vmware 9 vs virtualbox 4.2"
Let’s talk virtualization
groupProject-1-Win8
How to boot a VM form a Forensic Image
Installing mandriva linux mandriva community wiki
system state backup restore
How To Fresh Install Windows X P Pro Without A Recovery C D
Installing win 7 os
The Holy Grail of Deployment
Cloud ready+installation+instructions
V sphere 5-upgrade-best-practices-guide[1]
V sphere 5-upgrade-best-practices-guide
Ad

Viewers also liked (8)

PPS
Master in javascript
PDF
5 stepmainttut
PDF
1 Student Windows Xp Tp Secure Guide
PPT
Java script
PDF
Winxp
PPS
Windows xp(1)
PDF
File17770
PPT
Windows XP concepts
Master in javascript
5 stepmainttut
1 Student Windows Xp Tp Secure Guide
Java script
Winxp
Windows xp(1)
File17770
Windows XP concepts
Ad

Similar to images_of_windows_xp_for_system_deployment_using_windows_pe (20)

DOCX
Building an standard image for windows7
PPT
Implications of Migrating to Windows Embedded Standard 7 (WES7) in Embedded A...
PDF
Booting an image as a forensically sound vm in virtual box
PDF
Returnil 2011
DOCX
Dual boot with a vhd final
PDF
CHDK installation guide
PPTX
PDF
NativeBoot-RatanM
PDF
Administering windows xp
PPTX
TDF Professional Conf 2010 - Rapid Windows 7 Deployments
PDF
Install VMWare Tools CentOS 7
PDF
Client install
PDF
ORION STARTER KIT….a real electronic laboratory (by FASAR ELETTRONICA)
PDF
Ibm smart cloud entry+ for system x user guide
PDF
trends in marketingFlip4 mac wmv user guide
PDF
Virtual dj 8 getting started
PDF
Virtual dj 8 getting started
PDF
Virtual dj 8 getting started
PDF
Virtual dj 8 getting started
PDF
Virtual dj 8 getting started
Building an standard image for windows7
Implications of Migrating to Windows Embedded Standard 7 (WES7) in Embedded A...
Booting an image as a forensically sound vm in virtual box
Returnil 2011
Dual boot with a vhd final
CHDK installation guide
NativeBoot-RatanM
Administering windows xp
TDF Professional Conf 2010 - Rapid Windows 7 Deployments
Install VMWare Tools CentOS 7
Client install
ORION STARTER KIT….a real electronic laboratory (by FASAR ELETTRONICA)
Ibm smart cloud entry+ for system x user guide
trends in marketingFlip4 mac wmv user guide
Virtual dj 8 getting started
Virtual dj 8 getting started
Virtual dj 8 getting started
Virtual dj 8 getting started
Virtual dj 8 getting started

Recently uploaded (20)

PDF
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
PDF
BoxLang Dynamic AWS Lambda - Japan Edition
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
DOCX
How to Use SharePoint as an ISO-Compliant Document Management System
PDF
AI Guide for Business Growth - Arna Softech
PDF
MCP Security Tutorial - Beginner to Advanced
PDF
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
PPTX
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
PPTX
Full-Stack Developer Courses That Actually Land You Jobs
PDF
Microsoft Office 365 Crack Download Free
PPTX
Trending Python Topics for Data Visualization in 2025
PPTX
Download Adobe Photoshop Crack 2025 Free
PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
PDF
Practical Indispensable Project Management Tips for Delivering Successful Exp...
PDF
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
PDF
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
PDF
Visual explanation of Dijkstra's Algorithm using Python
DOCX
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
BoxLang Dynamic AWS Lambda - Japan Edition
Advanced SystemCare Ultimate Crack + Portable (2025)
How to Use SharePoint as an ISO-Compliant Document Management System
AI Guide for Business Growth - Arna Softech
MCP Security Tutorial - Beginner to Advanced
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
Full-Stack Developer Courses That Actually Land You Jobs
Microsoft Office 365 Crack Download Free
Trending Python Topics for Data Visualization in 2025
Download Adobe Photoshop Crack 2025 Free
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
Practical Indispensable Project Management Tips for Delivering Successful Exp...
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
Visual explanation of Dijkstra's Algorithm using Python
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx

images_of_windows_xp_for_system_deployment_using_windows_pe

  • 1. Creating WIM images of Windows XP for system deployment using Windows PE 01/14/2008 Isaac Holmes
  • 2. WIM Imaging Tutorial v1.5 Page 2 Table of Contents Introduction: ................................................................................................................................................. 4 Requirements: ............................................................................................................................................... 5 Creating a basic Windows PE disk for troubleshooting or image capture or deployment: .......................... 6 Installing drivers to Windows PE: .............................................................. Error! Bookmark not defined. Capturing a WIM disk images using Windows PE and ImageX: .................................................................... 9 Capture to USB or local drive: ................................................................................................................... 9 Capture to a network file share: ............................................................................................................. 10 Partition and Format the Hard Drive from Windows PE: ........................................................................... 11 Partition and Format drive from Windows PE Single Partition: ............................................................. 11 Partition and Format drive from Windows PE Two Partitions: .............................................................. 12 DISKPART Scripting:................................................................................................................................. 13 Deploying WIM images: .............................................................................................................................. 14 Deploy from USB drive: ........................................................................................................................... 14 Deploy from Network Share: .................................................................................................................. 14 Deploy from CD/DVD: ............................................................................................................................. 15 Command Files for automation of Base Windows PE ISO Image: .............................................................. 16 Create_Mount.cmd ................................................................................................................................. 16 Install_Packages.cmd .............................................................................................................................. 16 Commit_Changes.cmd ............................................................................................................................ 17 Create_ISO.CMD ..................................................................................................................................... 17 Install_Drivers.CMD ................................................................................... Error! Bookmark not defined. Build_All.CMD ......................................................................................................................................... 17
  • 3. WIM Imaging Tutorial v1.5 Page 3 Appendices: ................................................................................................................................................. 18 Appendix A: Adding your own startup commands or applications ....................................................... 18 Appendix B: Remove boot prompt ........................................................................................................ 18 Appendix C: Using Driverpacks from Driverpacks.net ........................................................................... 18 Appendix D: Using Ghost instead of ImageX ......................................................................................... 18 Appendix E: Exclude files during capture using an ImageX configuration file ....................................... 19 Exclusion List Guidelines ..................................................................................................................... 19 Appendix F: Booting Windows PE from USB Flash Drive (UFD) ............................................................. 20 Additional Resources: ................................................................................................................................. 21 References: ................................................................................................................................................. 21
  • 4. WIM Imaging Tutorial v1.5 Page 4 Introduction: With the release of Vista, Microsoft has developed a new method of deploying machines. Part of this new deployment method is the use of file based images called the Windows Imaging format or WIM. What’s the difference between a Ghost image and a WIM image? Ghost doesn't know or care what format the drive or partition is that it is copying: FAT, FAT32, Linux EXT3, HPFS, or NTFS. To it disks are just partitions and partitions are sectors. Ghost will read a sector from the hard disk, compress it and place it into an image file, then continue with the sector, and the next until it has finished copying the disk or partition, which is why it is called "sector-based" imaging. WIMs are file- and folder- based, and deploy in a mostly non-destructive manner. When you deploy a sector-based image to a hard disk, you destroy whatever partitions sit on that disk; re-imaging a system with Ghost means wiping out the drive. However, when deploying a WIM to a system it means only overwriting whatever files are in the WIM, and no others. As an example, if you had a Windows XP workstation whose hard disk contained a folder named "c:saveddocs" which held hundreds of documents and you then re-apply the original image to that computer, then you would have a clean copy of the operating system because you overwrote the old one, but the c:saveddocs folder would still exist in its untouched state. You can also use the WIM format at no cost. All of the WIM tools are a free download from Microsoft as part of the Windows Automated Installation Kit. Ghost, Acronis and other products like them in general all cost money. One other important difference is that as of this writing there is currently no method to multicast a WIM image to multiple machines at once. This is being added to Server 2008 with the Windows Deployment Services.
  • 5. WIM Imaging Tutorial v1.5 Page 5 Requirements: To work through this tutorial you will need the following: Technician Machine to run utilities on with the following: o WAIK (Windows Automated Installation Kit) installed on Technician machine  Download: http://www.microsoft.com/downloads/details.aspx?familyid=C7D4BC6D-15F3- 4284-9123-679830D629F2&displaylang=en o Technician machine will need a CD/DVD-R/RW o 2 GB of free disk space to install WAIK and work on Windows PE image. Source system o System configured as desired and ready for image capture. Destination system o System to test the deployment of your image to. o System must be the same or compatible with the source system unless you are using the Universal Imaging Utility External USB drive or network file share with enough space to store the image, a secondary drive in the source system is also acceptable. Blank CD/DVD-R/RW media, number depends upon method of deployment and image size.
  • 6. WIM Imaging Tutorial v1.5 Page 6 Creating a basic Windows PE disk for troubleshooting or image capture or deployment: 1. Download and install WAIK on technician system machine. 2. Create your source system with software installed and configured as desired and ready to be imaged as you have always done. 3. On technician system launch ‘Windows PE Tools Command Prompt’ from ‘Microsoft Windows AIK’ on the Programs Menu. The entire CD build process is performed in this CMD window. 4. To begin building a Windows PE CD type: copype.cmd x86 c:winpe_x86 a. Where x86 is the desired system architecture (x86 or amd64) b. And c:winpe_x86 is your desired working location for Windows PE; this directory must not already exist. 5. Now mount the Windows PE boot image as a folder on your machine so that it may be edited by typing the following: imagex /mountrw c:winpe_x86winpe.wim 1 c:winpe_x86mount 6. To copy servicing tools into the mounted PE image, type: xcopy "C:Program FilesWindows AIKToolsServicing" c:winpe_x86mountWindows /s xcopy "C:Program FilesWindows AIKToolsx86" c:winpe_x86mountWindows /s /Y 7. If you wish to add any additional files such as additional diagnostic tools, Ghost32 or other standalone applications copy them now to: (Remember this is a limited Windows environment it will not have all of the functionality of a normal Windows installation.) c:winpe_x86mount – this will be the X: drive when booted from the CD and everything here loads into memory, the more you put here the more memory that will be required. c:winpe_x86ISO – this is the CD itself, put large files like the image files here. 8. Install additional support options: These are not required for image capture or deployment, but if you need the ability to run
  • 7. WIM Imaging Tutorial v1.5 Page 7 scripts, use WMI, or any other item listed below it must be explicitly installed before continuing. If you decide you want them later you will have to start the process over. a. Windows Recovery Environment component peimg /install=WinPE-SRT-Package c:winpe_x86mountWindows b. HTML application Support peimg /install=WinPE-HTA-Package c:winpe_x86mountWindows c. Microsoft Data Access Component support peimg /install=WinPE-MDAC-Package c:winpe_x86mountWindows d. Windows Script Host support peimg /install=WinPE-Scripting-Package c:winpe_x86mountWindows e. Microsoft XML (MSXML) parser support peimg /install=WinPE-XML-Package c:winpe_x86mountWindows f. WMI (Windows Management Instrumentation) peimg /install=WinPE-WMI-Package c:winpe_x86mountwindows 9. Prepare the Windows PE Image by typing, this removes unneeded items from the image: peimg /prep c:winpe_x86mountWindows /f 10. Install hardware drivers if necessary before continuing, see next chapter. 11. To commit the changes made to Windows PE, type: imagex /unmount c:winpe_x86mount /commit 12. Copy the updated WIM to the ISO folder for creation: copy c:winpe_x86winpe.wim c:winpe_x86ISOsourcesboot.wim /Y 13. Create your ISO image: oscdimg -n -bc:winpe_x86etfsboot.com c:winpe_x86ISO c:winpe_x86winpe_x86.iso 14. Using your preferred CD creation software burn the disk image c:winpe_x86winpe_x86.iso to CD or CD-RW.
  • 8. WIM Imaging Tutorial v1.5 Page 8 Installing Drivers Drivers can be added to both an online and offline images using different tools. Drvload loads drivers to a booted Windows PE environment while the PEImg tool installs them to the offline image. If the driver requires a reboot to activate you should install it using PEimg, Drvload will ignore the reboot but will not initialize the .sys driver. Installing drivers to offline Windows PE image: 1. Collect the drivers you wish to install and save them to a folder based on the device they are designed for. C:driversLAN C:driversMSD etc. 2. Extract the drivers from their compressed packages; this process will vary depending upon the method used by the manufacturer. Place each driver in its own sub-folder under its device type folder c:driversnet, c:driversmsd, etc. c:driversnetintel100 c:driversnetbroadcom100 c:driversMSDintel c:driversMSDAMD etc. 3. Run the following command for each folder, where <source path> is the directory containing the driver INF file, and <destination path> (i.e. c:winpe_x86mount) is the path to you mounted Windows PE image: peimg /inf:<source path>*.inf <destination path>windows Installing drivers to running Windows PE: 1. Collect the drivers you wish to use after booting. 2. Drivers should be extracted to folder and placed in folder on CD or USB device. 3. Run the following command after booting from you PE CD where <source path> is the directory containing the desired driver(s), multiple <source paths> can be specified by separating them with a comma: Drvload <source path>, <source path 2>, <source path 3> Make the PE image smaller: After installing packages and drivers the Windows PE image is likely bloated with unused items. To remove the unused items run the following where <source wim> is the bloated image and <dest wim> will be the cleaned up image. <dest wim> must not already exist. Imagex /boot /export <source wim> 1 <dest wim>
  • 9. WIM Imaging Tutorial v1.5 Page 9 Capturing a WIM disk images using Windows PE and ImageX: Capture to USB or local drive: 1. Connect your USB or secondary drive to the machine to be imaged. 2. Turn on computer and boot from your newly create Windows PE CD. 3. Windows PE will load and launch a CMD window and run WPEINIT, do not close this window as this will cause the machine to reboot. 4. Verify the USB/secondary drive and the drive to be imaged are both seen, the internal drive should be C:, and the USB or secondary drive D:, but this is not always the case depending upon BIOS configurations. The CD will be the next drive letter after the last partition and the RAM drive where the OS is running from will be X:. As long as you know what is on your drive a simple DIR listing of each drive should suffice to determine the drive letters. For our example we will assume the internal hard drive is C: and the USB/secondary drive is D: 5. To capture the first partition in the CMD window type: imagex /capture c: d:C_Image.wim “Drive C” “My image description” /compress maximum Note: Imagex only captures or deploys partitions; it does not capture full disks. If your disk contains more than one partition you will need to capture each individually. You can capture each partition to the same file by using the following command to append the additional partitions to the existing WIM (assuming D: is the second partition and E: is the USB/secondary drive): imagex /append d: e:C_Image.wim “Drive D” 6. If you will be putting your image on CD/DVD you may need to split the final image into smaller pieces to fit on the media do that now with this command: imagex /split d:C_Image.wim 650 This will split the image into 650mb chunks on in the same location as the image file. You can split the image into larger or smaller size chunks by changing the 650 to you desired size in megabytes. If you wish to split it to a different location add the path after the source file name: imagex /split d:c_image.wim d:splitfile 650 7. You are now ready to deploy your image.
  • 10. WIM Imaging Tutorial v1.5 Page 10 Capture to a network file share: You must have created you Windows PE CD with the appropriate network drivers in order to capture the image to the network. 1. Turn on computer and boot from your newly create Windows PE CD. 2. Windows PE will load and launch a CMD window and run WPEINIT, do not close this window as this will cause the machine to reboot. 3. Verify the drive to be imaged is seen, the internal drive should be C:. The CD will be the next drive letter after the last hard drive partition and the RAM drive where the OS is running from will be X:. As long as you know what is on your drive a simple DIR listing of each drive should suffice to determine the drive letters. 4. There are two options to connect to a network share: a. Map share to a drive letter: i. In CMD window type: NET USE K: myserverimages ii. The net use command in Windows PE is the same as in Windows XP. b. Use UNC path: i. In CMD window type: SETLOCAL ENABLEEXTENSIONS ii. You will now be able to use UNC paths in the CMD window in place of drive letters. 5. If you chose to use UNC paths replace K: with the path to your share (myserverimages) in the following steps. 6. To capture the first partition in the CMD window type: imagex /capture c: K:C_Image.wim “Drive C” “My image description” /compress maximum Note: Imagex only captures or deploys partitions; it does not capture full disks. If your disk contains more than one partition you will need to capture each individually. You can capture each partition to the same file by using the following command to append the additional partitions to the existing WIM (assuming D: is the second partition and E: is the USB drive): imagex /append K: e:C_Image.wim “Drive D” 7. If you will be putting your image on CD/DVD you may need to split the final image into smaller pieces to fit on the media do that now with this command: imagex /split K:C_Image.wim 650 This will split the image into 650mb chunks on in the same location as the image file. You can split the image into larger or smaller size chunks by changing the 650 to you desired size in megabytes. If you wish to split it to a different location add the path after the source file name: imagex /split K:c_image.wim d:splitfile 650 8. You are now ready to deploy your image.
  • 11. WIM Imaging Tutorial v1.5 Page 11 Partition and Format the Hard Drive from Windows PE: Unlike Ghost, ImageX does not partition and format the drive as the image is deployed. It will in fact overwrite only the files that are contained within the WIM file. To start off a machine from scratch with a new image you must first partition and format the drive as desired. Following is the procedure for partitioning and formatting the hard drive from Windows PE as a single partition. Partition and Format drive from Windows PE Single Partition: 1. From CMD window run DISKPART. DISKPART will present its own prompt. 2. Determine Disk order, type: LIST DISK 3. Select the disk to be imaged, change the number to correspond to your destination, type: SELECT DISK 0 4. To erase everything on the disk type: CLEAN 5. Create primary partition: CREATE PART PRI 6. Select the newly created partition: SELECT PART 1 7. Set partition active: ACTIVE 8. Assign it a drive letter: ASSIGN LETTER=C: 9. Format the drive: FORMAT FS=NTFS LABEL=”CDRIVE” QUICK 10. Exit DISKPART: EXIT
  • 12. WIM Imaging Tutorial v1.5 Page 12 Partition and Format drive from Windows PE Two Partitions: 1. From CMD window run DISKPART. DISKPART will present its own prompt. 2. Determine Disk order, type: LIST DISK 3. Select the disk to be imaged, change the number to correspond to your destination, type: SELECT DISK 0 4. To erase everything on the disk type: CLEAN 5. Create primary partition, size in MB: CREATE PART PRI SIZE=1000 6. Select the newly created partition: SELECT PART 1 7. Set partition active: ACTIVE 8. Assign it a drive letter: ASSIGN LETTER=C: 9. Format the drive: FORMAT FS=NTFS LABEL=”CDRIVE” QUICK 10. Create extended partition: CREATE PART EXT 11. Create logical disk: CREATE PART LOG 12. Select logical disk: SELECT PART 2 13. Format logical partition: FORMAT FS=NTFS LABEL=”CDRIVE” QUICK Note: Notice you do not have to assign a drive letter to a partition to format it. It formats the currently selected partition. 14. Assign it a drive letter: ASSIGN LETTER=E Note: D: is already assigned to your CD, the letters assigned to the drive are good only for this session of Windows PE and have no bearing anywhere else. 15. Exit DISKPART: EXIT
  • 13. WIM Imaging Tutorial v1.5 Page 13 DISKPART Scripting: DISKPART is also scriptable so that you do not have to manually type in all the commands to partition your disk. WARNING: If your disks are not in the order expected when the script is run the wrong disk could be selected and wiped clean thereby losing data. To run a DISKPART script us the following command: DISKPART /s myscript.txt SinglePartition.txt SELECT DISK 0 CLEAN CREATE PART PRI SELECT PART 1 ACTIVE ASSIGN LETTER=C: FORMAT FS=NTFS LABEL=”CDRIVE” QUICK EXIT DualPartition.txt SELECT DISK 0 CLEAN CREATE PART PRI SELECT PART 1 ACTIVE ASSIGN LETTER=C: FORMAT FS=NTFS LABEL=”CDRIVE” QUICK CREATE PART EXT CREATE PART LOG SELECT PART 2 ASSIGN LETTER=D FORMAT FS=NTFS LABEL=”CDRIVE” QUICK EXIT
  • 14. WIM Imaging Tutorial v1.5 Page 14 Deploying WIM images: Deploy from USB drive: 1. Connect USB drive to destination machine. 2. Boot from Windows PE CD 3. Partition and format the partition as shown above. 4. Deploy image to drive: imagex /apply d:C_Image.wim “Drive C” C: 5. If you need to make any changes to the image you can now access all of the files written from the image and modify them as needed. 6. Remove media and reboot. Deploy from Network Share: You must have created you Windows PE CD with the appropriate network drivers in order to capture the image to the network. 1. Boot from Windows PE CD 2. Partition and format the partition as shown above. 3. There are two options to connect to a network share: a. Map share to a drive letter: i. In CMD window type: NET USE K: myserverimages ii. The net use command in Windows PE is the same as in Windows XP. b. Use UNC path: i. In CMD window type: SETLOCAL ENABLEEXTENSIONS ii. You will now be able to use UNC paths in the CMD window in place of drive letters. 4. If you chose to use UNC paths replace K: with the path to your share (myserverimages) in the following steps. 5. Deploy image to drive: imagex /apply K:C_Image.wim “Drive C” C: 6. If you need to make any changes to the image you can now access all of the files written from the image and modify them as needed. 7. Remove media and reboot.
  • 15. WIM Imaging Tutorial v1.5 Page 15 Deploy from CD/DVD: 1. First, add the WIM image to your CD/DVD. a. Repeat the process to create a Windows PE CD to the point where you can add your own custom files. b. Add the image WIM file to the ISO folder. c. Finish the ISO image creation and burn to CD/DVD. 2. Boot target machine from your Windows PE CD/DVD containing your image file. 3. Partition and format drive as needed. 4. Determine the drive letter of your CD/DVD. 5. Replace d: in imagex /apply command with the letter of your CD/DVD as needed to access WIM. 6. Apply image: imagex /apply d:C_Image.wim “Drive C” C: 7. If you need to make any changes to the image you can now access all of the files written from the image and modify them as needed. 8. Remove media and reboot.
  • 16. WIM Imaging Tutorial v1.5 Page 16 Command Files for automation of Base Windows PE ISO Image: If desired change the variable values at the beginning of these CMD scripts to point to the directories you wish to use. Place these CMD files in C:program filesWindows AIKToolsPETools and run them from the “Windows PE Tools Command Prompt” or you need to add the path to the PETools directory to your Path statement which is done by pesetenv.cmd when you open the “Windows PE Tools Command Prompt” Create_Mount.cmd Set DestFolder=C:winpe_x86 Set Arch=x86 copype.cmd %Arch% %DestFolder% imagex /mountrw %DestFolder%winpe.wim 1 c:winpe_x86mount xcopy "C:Program FilesWindows AIKToolsServicing" %DestFolder%mountWindows /s xcopy "C:Program FilesWindows AIKTools%Arch%" %DestFolder%mountWindows /s /Y exit Install_Packages.cmd Set DestFolder=C:winpe_x86 rem peimg /install=WinPE-SRT-Package %DestFolder%mountWindows peimg /install=WinPE-HTA-Package %DestFolder%mountWindows peimg /install=WinPE-MDAC-Package %DestFolder%mountWindows peimg /install=WinPE-Scripting-Package %DestFolder%mountWindows peimg /install=WinPE-XML-Package %DestFolder%mountWindows peimg /install=WinPE-WMI-Package %DestFolder%mountwindows peimg /prep %DestFolder%mountWindows /f Install_Drivers.CMD When calling pass a variable pointing to the driver directory which contains the drivers you wish to install, the given directory will be recursively searched. set Drivers=% 1 set DestFolder=c:winpe_x86 pushd %Drivers% for /f %%i in ('dir /s /b *.inf') do ( peimg /inf:%%i %DestFolder%mountwindows if ERRORLEVEL 1 echo %%i>>%Drivers%bad_driver.txt ) popd
  • 17. WIM Imaging Tutorial v1.5 Page 17 Commit_Changes.cmd Set DestFolder=C:winpe_x86 imagex /unmount %DestFolder%mount /commit Create_ISO.CMD Set DestFolder=C:winpe_x86 copy %DestFolder%winpe.wim %DestFolder%ISOsourcesboot.wim /Y oscdimg -n –b%DestFolder% etfsboot.com %DestFolder%ISO %DestFolder%winpe_x86.iso Build_All.CMD Set Architecture=x86 Set PEDest=c:winpe_x86 Set ISOName=winpe_x86.iso Set installmsd=true Set MSDPath=c:driversMSD Set installlan=true Set LanPath=c:drivesLAN Set removeboot=true pushd %cd% call copype.cmd %Architecture% %PEDest% imagex /mountrw %PEDest%winpe.wim 1 %PEDest%mount xcopy "C:Program FilesWindows AIKToolsServicing" %PEDest%mountWindows /s xcopy "C:Program FilesWindows AIKTools%Architecture%" %PEDest%mountWindows /s /Y peimg /install=WinPE-SRT-Package %PEDest%mountWindows peimg /install=WinPE-HTA-Package %PEDest%mountWindows peimg /install=WinPE-MDAC-Package %PEDest%mountWindows peimg /install=WinPE-Scripting-Package %PEDest%mountWindows peimg /install=WinPE-XML-Package %PEDest%mountWindows peimg /install=WinPE-WMI-Package %PEDest%mountWindows if "%installmsd%"=="true" call Install_MSD.cmd %MSDPath% if "%installlan%"=="true" call Install_Network.cmd %LANPath% peimg /prep %PEDest%mountWindows /f imagex /unmount %PEDest%mount /commit imagex /boot /export %PEDest%winpe.wim 1 %PEDest%shrink.wim copy %PEDest%shrink.wim %PEDest%ISOsourcesboot.wim /Y if "%removeboot%"=="true" del /q %pedest%isobootbootfix.bin oscdimg -n -b%PEDest%etfsboot.com %PEDest%ISO %PEDest%%ISOName% popd
  • 18. WIM Imaging Tutorial v1.5 Page 18 Appendices: Appendix A: Adding your own startup commands or applications With the image mounted edit c:winpe_x86mountwindowssystem32startnet.cmd and add your own commands to the end of the file to automate functions at startup. Or you can create a text file named c:winpe_x86mountwindowssystem32Winpeshl.ini, set the AppPath value in Winpeshl.ini to the application you wish to run, command line options are not supported. Use the [LaunchApps] section to run applications with command-line options. The applications run in the order listed; separate the name of the application from its options with a comma. Winpeshl.ini [LaunchApp] AppPath=%systemdrive%system32myshell.exe [LaunchApps] %SYSTEMDRIVE%mydirapplication1.exe, -option1 -option2 application2.exe, -option1 -option2 Appendix B: Remove boot prompt To remove the “Press any Key to boot from CD or DVD” prompt when booting from CD, delete bootfix.bin from c:winpe_x86ISOboot before running OSCDIMG to create the CD ISO image. Appendix C: Using Driverpacks from Driverpacks.net At the time of this writing the current version of the LAN Driverpack is 7.121, Mass Storage is 7.121. If you intend to use the Driverpacks to install drivers you will find that you will receive a half dozen or so errors if you try installing all of the drivers available. This is due to there being some drivers for Windows 9x and NT systems which are not compatible with Windows PE 2.0. I have also found that some of the Mass storage drivers when installed prevent Windows PE from booting, at this time the known offending drivers are in the following folders when expanded: DMAD8, DM3B, DMD. If you remove these directories the rest of the OEMSETUP drivers install and Windows PE boots without any issues. Appendix D: Using Ghost instead of ImageX You can use Ghost instead of ImageX to handle imaging during the building of your Windows PE ISO. At a minimum you will need to add GHOST32.EXE to your CD, you can also use the other 32-bit application included like GDISK32, GhRegEdit32, GhWalk32, Ghostexp, etc. Then you can use Ghost as you have in the past but use the 32-bit Windows version instead of the 16-bit DOS version.
  • 19. WIM Imaging Tutorial v1.5 Page 19 Appendix E: Exclude files during capture using an ImageX configuration file By default ImageX excludes certain files from being included in the image during a capture. Default Exclusion list: [ExclusionList] $ntfs.log hiberfil.sys pagefile.sys "System Volume Information" RECYCLER WindowsCSC [CompressionExclusionList] *.mp3 *.zip *.cab WINDOWSinf*.pnf You can define your own additional exclusion by creating a configuration INI file and referencing it during image capture. To use your custom list add /config x:<config file path>configuration.ini to your ImageX capture command: imagex /config x:<config file path>configuration.ini /capture c: d:C_Image.wim “Drive C” “My image description” /compress maximum If you name the configuration file wimscript.ini and place it in the same folder as ImageX it will run automatically when using the /capture switch without needing to use the /config switch. Exclusion List Guidelines You can only use wildcards in the last component in a file path that does not begin with a preceding back slash. For example, myfolder*.txt You can use a preceding backward slash to limit file- and directory-matching relative to the root directory. For example, if you capture the "c:" drive with the previous exclusion list, myfolder foldersubfolder Then ImageX will exclude the following root directories and their files, C:myfolder c:foldersubfolder But will not exclude sub-folders of the same name for example,
  • 20. WIM Imaging Tutorial v1.5 Page 20 C:mainmyfolder c:datafoldersubfolder You can override the default exclusion list by using the [ExclusionException] section. For example, [ExclusionException] pagefile.sys "System Volume Information" If an explicit [ExclusionException] section is provided in the WIM configuration file, it will always take precedence over the [Exclusion List] section. You cannot override the default compression exclusion list by using the [ExclusionException] section. Appendix F: Booting Windows PE from USB Flash Drive (UFD) Before you can place Windows PE on a UFD device, you must use Diskpart to format the UFD with a Windows Vista or Windows PE environment. 1. From a running Windows Vista operation system or Windows PE session, insert your UFD device. 2. At a command prompt, use Diskpart to format the device as FAT32 spanning the entire device, and set the partition as active. For example, Diskpart select disk 1 clean create partition primary select partition 1 active format fs=fat32 assign exit The example above assumes disk 1 is the UFD. 3. On your technician computer, copy all the content in the ISO directory onto 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, xcopy c:winpe_x86iso*.* /s /e /f f: where c: is your technician computer hard disk and f: is your UFD device..
  • 21. WIM Imaging Tutorial v1.5 Page 21 Additional Resources: ImageX GUI interface – http://www.msfn.org/board/index.php?showtopic=99148 DISKPART GUI Interface – Disk Partitioner v1.2 http://www.911cd.net/forums//lofiversion/index.php?t13516.html Driverpacks – Network and Mass Storage driver packs http://www.driverpacks.net References: http://technet2.microsoft.com/WindowsVista/en/library/129a1712-e3d8-46c1-bc09- a14349dc67db1033.mspx?mfr=true WINPE.CHM – Help file installed by WAIK Technical Advisors: JuMz - msfn.org Chiners_68 – msfn.org p4ntboy – msfn.org DigeratiPrime – msfn.org