Welcome to TechNet Blogs Sign in | Join | Help

Off Campus

Michael Greene - DataCenter TSP - US Education

News

  • The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

    Subscribe as Email

    My TechNet Edge Profile

    Blue Monster

Edit the registry on a mounted WIM

This is an incredibly valuable task.  Windows Vista employs "Image Based Setup", meaning their is no more i386 folder.  Instead, Windows now comes on the DVD as an image that is copied and expanded during setup.  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?

Mount the WIM file to a local folder using ImageX.

C:\ImageX>imagex /mountrw install.wim 1 c:\mount

ImageX Tool for Windows
Copyright (C) Microsoft Corp. 1981-2005. All rights reserved.

Mounting (RW): [C:\ImageX\install.wim, 1] ->
[c:\mount]

Successfully mounted image (RW).

Load the registry hive you need.  In this case let's mount HKLM\Software.

C:\mount>reg load HKLM\test c:\mount\windows\system32\config\software

The operation completed successfully.

Open Regedit to make changes or use Reg Add from the command line.

RegEdit with software hive loaded as

Unload the reg hive.

C:\Windows\system32>reg unload HKLM\test

The operation completed successfully.

Unmount the image.

C:\ImageX>imagex /unmount /commit c:\mount

ImageX Tool for Windows
Copyright (C) Microsoft Corp. 1981-2005. All rights reserved.

Unmounting: [c:\mount]...

Successfully unmounted image.

It really is that simple.  Changes to be made without having to apply, sysprep, and recapture the image.  You could leverage this as a tool in a variety of ways such as to embed a script to run application installations after the image has been deployed, automate activation using slmgr.vbs, etc.

Posted: Thursday, December 07, 2006 8:51 AM by michael.greene

Comments

Dimo said:

I don't have the mount command in windows xp.

Where do I get it?

I can do the rest of the things but when I run mount>reg mount is not recognized command.

Thank you.

# August 12, 2008 3:11 PM

JP said:

Dimo:  You need to install Imagex.  Google "Imagex" or search on Microsoft's site.  An alternative is Gimagex which is a GUI-based frontend for imagex developed by a third party.  Imagex is command-line based and is what you need to run the commands shown in this article.

# September 8, 2008 3:04 PM

world free said:

it should be noted that when using imagex that you must select the correct index to modify containing the correct version of Vista (ex. Business, Ultimate, etc.).  this is the "1" in "C:\ImageX>imagex /mountrw install.wim 1 c:\mount".  you can find the correct index number by doing a "imagex /info install.wim" and noting the index number in the report.

# December 31, 2008 5:18 PM

Brian Reich said:

JP,

You need to download the Windows Automated Installation Kit to get imagex, peimg, and the rest of the command-line tools.

# July 9, 2009 11:47 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker