Wednesday 20 January 2010

Mount and modify a current WIM file

This is an incredibly valuable task


An admin can capture a custom .WIM windows image and mount the WIM to add/modify/remove files. Did you know you can also edit the registry?



  • Prerequisites

Before you can mount and manipulate an image with ImageX, you must perform the following tasks:


Install Windows OPK tools or Windows AIK tools on your technician computer.
Use ImageX to capture (and, optionally, to compress) your installation to an image (.wim) file.
Create a folder on the c drive and call it: mount



  • To mount an image

On your technician computer, at a command prompt, open the ImageX directory.
c:\Program Files\\Tools\
.
Mount the image. For read-only permissions, use
imagex /mount d:\imaging\data.wim 2 c:\mount
For read/write permissions, use
imagex /mountrw d:\imaging\data.wim 2 c:\mount
where c:\mount is the location of the mount directory, d:\imaging\data.wim is the name and the location of the .wim file to mount, and 2 is the reference number of the specific volume in the .wim file.
Now you can open the mounted Image just like a folder structure through explorer, but the best part is that you can also modify the Registry setting
Load the registry hive you need. In this case let's mount HKLM\Software under the TEST name to identify the String in the registry.
C:\mount>reg load HKLM\TEST c:\mount\windows\system32\config\software
The operation completed successfully.
Open Regedit to make changes under the TEST string
Unload the reg hive.
C:\mount>reg unload HKLM\test
Then Unmount the Image with Commit switch to apply the changes to the WIM file – make sure you have closed explorer windows etc.
On your technician computer, at a command prompt, open the ImageX directory.
c:\Program Files\\Tools\
where can be Windows OPK or Windows AIK and can be x86, amd64, or ia64.
Then type:
imagex /unmount /commit c:\mount

If you do not use the commit switch no changes will be saved.

No comments:

Post a Comment