How to image your PC and apply the image!!!

ImageX Procedures

The tool used to create and apply these images is ImageX—which is included in the Windows Automated Installation Kit (AIK):

https://www.microsoft.com/downloads/details.aspx?FamilyID=c7d4bc6d-15f3-4284-9123-679830d629f2&DisplayLang=en

The following procedures detail how to create the ImageX boot CD. There are also procedures describing how to use the CD to capture and apply an image.

Creating the Boot CD

Note: the following procedure was performed on one of the development workstations with the AIK installed.

For more information on this procedure see the following URL:

https://technet2.microsoft.com/WindowsVista/en/library/7a47a896-ca59-4586-b688-3a3c098d34241033.mspx

1. From the Start -> All Programs -> Microsoft Windows AIK menu, launch the Windows PE Tools Command Prompt

This is the command prompt that we’ll do all of our AIK work.

2. Setup the PE environment by executing the following command:

copype.cmd x86 c:\winpe_x86

This creates the working directories for the architecture ‘x86’ on the destination folder ‘c:\winpe_x86’

3. Add ImageX to the environment by executing the following command:

copy “C:\Program Files\Windows AIK\Tools\x86\imagex.exe” c:\winpe_x86\iso\

Now the ImageX tool will be part of our boot CD.

4. Add Bootsect to the environment by executing the following command:

copy “C:\Program Files\Windows AIK\Tools\PETools\x86\bootsect.exe” c:\winpe_x86\iso\

Now the Bootsect tool will be part of our boot CD.

5. Add Package Manager to the environment by executing the following command(s):

xcopy “C:\Program Files\Windows AIK\Tools\x86\Servicing” c:\winpe_x86\iso\Servicing /s

copy %windir%\system32\msxml6*.dll c:\winpe_x86\iso\Servicing

Package Manager isn’t strictly required by us but it can’t hurt to include it.

6. Create an exclusion list by completing the following tasks:

a. Create file called c:\winpe_x86\iso\wimscript.ini

b. Add the following contents to the wimscript.ini file

[ExclusionList]

ntfs.log

hiberfil.sys

pagefile.sys

"System Volume Information"

RECYCLER

Windows\CSC

[CompressionExclusionList]

*.mp3

*.zip

*.cab

\WINDOWS\inf\*.pnf

These files won’t be included in any images that we capture (they aren’t required and may be locked when we try to perform the capture).

7. Create a bootable CD-ROM by executing the following command(s):

oscdimg –n –bc:\winpe_x86\etfsboot.com c:\winpe_x86\iso c:\winpe_x86\winpe_x86.iso

We now have an ISO image for our bootable CD.

8. Burn the winpe_x86.iso file to a CD-ROM. Label the CD-ROM:

ImageX Boot CD

We now have bootable CD that we can use to capture and apply images.

Capturing an Image

For more information on this procedure see the following URL:

https://technet2.microsoft.com/WindowsVista/en/library/2560956b-8b57-4dc9-9047-448c0f01c2d11033.mspx?mfr=true

1. Boot the computer that you want to image with the ImageX Boot CD.

The computer boots and you’re presented with a command prompt.

2. Determine what volumes are mounted by executing the following command(s):

diskpart

list volume

exit

This lists all of the volumes that are mounted (along with their drive letters). Note these and modify the drive letter assumptions in the rest of this procedure as appropriate.

3. Capture the image by executing the following commands (modify the image name as appropriate):

<CD-Drive>:

imagex /compress fast /capture C:\ D:\Images\ImageX\data.wim “Image Name”

Replace <CD-Drive> with the letter of the CD-ROM drive.

We have captured an image of our computer. This command line assumes the following:

· The drive we’re capturing is C:\

· The directory where we’re storing images is D:\Images\ImageX

· The name of the image file is data.wim

· The name of the image is Image Name

Any of these parameters can be modified as appropriate.

4. When you’re ready to exit WinPE execute the following command(s):

exit

WinPE terminates and the machine reboots.

Applying an Image

For more information on this procedure see the following URL:

https://technet2.microsoft.com/WindowsVista/en/library/a52fa60c-aaab-4ab9-bd8d-ee745e11d6d51033.mspx?mfr=true

1. Boot the computer that you want to restore an image to with the ImageX Boot CD.

The computer boots and you’re presented with a command prompt.

2. Determine what volumes are mounted by executing the following command(s):

diskpart

list volume

exit

This lists all of the volumes that are mounted (along with their drive letters). Note these and modify the drive letter assumptions in the rest of this procedure as appropriate.

3. Repartition the hard disk and update the master boot code by completing the following tasks:

a. Determine if you want to repartition the hard disk. Only perform this procedure if you want to delete ALL data on the disk for ALL partitions. If you do not, then SKIP THE REST OF THIS STEP (we’ll still format the primary partition in the next step).

b. Execute the following commands:

diskpart

select disk 0

clean

create partition primary size=110000

select partition 1

active

exit

Replace <CD-Drive> with the letter of the CD-ROM drive.

This repartitions the entire hard disk, leaving only a single primary partition to which we’ll apply our image. This

4. Reformat the primary partition by executing the following command(s):

diskpart

select disk 0

select partition 1

format fs=ntfs quick

exit

This formats the partition to which we’ll be applying our image.

5. Update the master boot code by executing the following command(s):

NOTE: this is OPTIONAL and only needs to be done if the master boot code is missing or has become corrupt (however, it will not harm anything by running this procedure on an already updated volume):

<CD-Drive>:

bootsect /nt60 SYS

This updates the master boot code on the system volume.

6. Apply an image by executing the following commands (modify the image name as needed):

<CD-Drive>:

imagex /apply D:\Images\ImageX\data.wim 1 C:\ /verify

Replace <CD-Drive> with the letter of the CD-ROM drive.

We have applied an image to our computer. This command line assumes the following:

· The drive we’re applying the image to is C:\

· The directory where we’re storing images is D:\Images\ImageX

· The name of the image file is data.wim

Any of these parameters can be modified as appropriate.

7. When you’re ready to exit WinPE execute the following command(s):

exit

WinPE terminates and the machine reboots.

 

- courtsey Michel