March 16 2010

Edit the registry inside a WIM file

An oldie but a goodie – this came about again when creating Windows 7 WIM files for SCCM. It really does save a lot of time – otherwise you would need to deploy your image, make changes to the registry and then recapture. This process is much quicker! I use the DISM tool from the WAIK toolkit but you could also use imageX to mount the image.


Mount the WIM

Open the Deployment Tools Command prompt and enter:

dism /mount-wim /wimfile:d:temptest.wim /index:1 /mountdir:c:mount


D:>dism /mount-wim /wimfile:d:temptest.wim /index:1 /mountdir:c:mount
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Mounting image
The operation completed successfully.


Load the registry hive

From a command prompt enter:

reg load HKLMtest c:mountwindowssystem32configsoftware


D:>reg load HKLMtest c:mountwindowssystem32configsoftware
The operation completed successfully.


Open regedit

You will then see the registry that is contained in the WIM file, in this case it is called test. Make your changes, then exit regedit.


Unload the registry hive

From a command prompt enter:

reg unload HKLMtest

D:>reg unload HKLMtest
The operation completed successfully.


Unmount the image

Open the Deployment Tools Command prompt and enter:

dism /unmount-wim /mountdir:c:mount /commit


D:>dism /unmount-wim /mountdir:c:mount /commit
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image File : d:temptest.wim
Image Index : 1
Saving image
Unmounting image
The operation completed successfully.


I use a maximum of one Google Ad per post to help offset some of my blog hosting costs.


Tags: , , , , , , ,

Posted March 16, 2010 by danovich in category "SMS / SCCM", "Tools


  1. By Jag on

    When u ran the command reg load HKLMtest c:mountwindowssystem32configsoftware ,from where did you load the reg key ? to get test Hive with all folders like adobe,apple computer INC etc ? I have a reg Key which i need to import but not sure how ?

  2. By danovich (Post author) on

    Jag, once you have mounted your WIM file into C:mount, you simply run ‘reg load HKLMtest c:mountwindowssystem32configsoftware’

  3. By ELDI on

    I make this small program in java for use the Dism.exe present in Windows 7 with GUI or Visual Mode,

    Download Link:
    GDism ELDI v2.2 Final:
    mediafire : ?uvxd4dk6kuv9ian (……)
    Commands you can use on GUI or Visual Mode:
    * Mount-Wim
    * Commit-Wim
    * Unmount-Wim
    * Get-WinInfo
    * Get-MountedWinInfo
    * CleanUp-Wim
    * Get-Packages
    * Add-Package
    * Remove-Package
    * Get-Drivers
    * Get-DriverInfo
    * Add-Driver
    * Remove-Driver
    * Make ISO
    You must need the JRE installed (Java Runtime Enviroment).


    Progress Bar
    Time Counter

    Fixed iso making
    Menu translated
    Button Cancel Process

    Better Interface for results text
    Make iso image with oscdimg
    Support WAIK
    Support x64
    Better Config File
    Size reduced

    Fixed Process on wait list
    Config File

    Translate English-Espanol
    Multiples Process Waiting

    Fixed Drivers Functions

  4. By Jeff on

    Ok this is nice. I want to delete the user profiles in my .wim file. I know that the settings are in this key:
    HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionProfileList
    I’ve mounted my .wim file and succeeded doing the software key. But how do I access the profile list?

  5. By Jeff on

    Foundet 🙂 registry editor in Windows server would not “expand” the “test” key. When opening in Windows 7 its OK

  6. By danovich (Post author) on

    Another tip – if you want to edit the Default User’s registry, once you have mounted the WIM in c:mount, simply use ‘reg load HKLMtest “C:mountDocuments and SettingsDefault UserNTUSER.DAT”‘ and open your registry editor.

    If you are looking for HKEY_CLASSES_ROOT, the is a subcomponent of SOFTWARE (HKEY_LOCAL_MACHINESoftwareClasses)

  7. By nice_guy75 on

    You can load the registry hives by other method as well, just open regedit and select HKLM and go to “File>load hives” and then navigate to “mountwindowssystem32config” and then select the “software” and you can give whatever name you wish, in the current example they have given “Test” name, now all your software registries are now loaded in “test” folder of HKLM. Now just change the path of registry you want to integrate from “HKLMsoftware” to “HKLMTest” and run the registry it will integrate the registry in wim.
    Don’t forget to unload the hives, select “Test” folder and go to “File>Unload hives” its all done.

  8. By LucyB on

    Thanks for the info. I did exactly what you mention here but I want to create a registry in HKLMsystemcurrentcontrolsetservices. How do you open this path in registry? It doesn’t show currentControlSet.
    Any help is very much appreciated.

  9. By danovich (Post author) on

    LucyB – I’ve pretty sure CurrentControlSet doesn’t exist until the OS is running, so you aren’t able to update it in an offline WIM file.

  10. By rsc on

    currentcontrolset01 is the saved state from offline PE. So if you change the key here it will be used if you boot from PE


Leave a Reply