Windows 10: DISM - Edit Registry on an Offline Image  

Page 1 of 2 12 LastLast
    DISM - Edit Registry on an Offline Image

    DISM - Edit Registry on an Offline Image

    How to use DISM to Edit Registry in Offline Windows 10 WIM (Image) File
    Published by Category: General Tips
    12 Oct 2017
    Designer Media Ltd

    Published by


    Kari's Avatar
    PhD in Malt Based Liquids


    Location: A Finnish expat in Germany
    Posts: 14,413

    Show Printable Version 


    information   Information
    Servicing an offline image, mounting an image, committing changes, it all sounds a bit complicated to an average Windows user. However, it's just geek speak meaning modifying default Windows install image, the install.wim file. It is a straight forward procedure. When changes have been committed (written, saved) to image, the modified install.wim can be used to deploy Windows or to replace original install.wim on existing install media.

    Servicing an offline image is done with DISM (Deployment Image Servicing and Management), a native Windows tool. DISM command options allow all kind of changes, changing the way Windows will be installed. Drivers can be added or removed, language packs applied to create a multilingual Windows install media, Windows Updates applied to get a new Windows installation to be up to date straight after installation, and so on.

    This tutorial will show how to modify Windows registry on an offline image.





    DISM - Edit Registry on an Offline Image Contents DISM - Edit Registry on an Offline Image
     Use links below to go to any step, back button of your browser to return to this list.


    Step One: Mount Offline Image
    Step Two: Edit Offline Registry
    Step Three: Commit (save) changes




    DISM - Edit Registry on an Offline Image Step One DISM - Edit Registry on an Offline Image
     Mount Offline Image
    1.1) Create a new folder, name it as you want to. In this example I create the folder on drive D: naming it ISO_Files.

    1.2) Mount a Windows 10 ISO image as virtual DVD by double clicking it. Open mounted ISO in Explorer, select all files and folders with CTRL + A and copy them with CTRL + C, paste the ISO content to ISO_Files folder with CTRL + V:
    Click image for larger version. 

Name:	image.png 
Views:	4942 
Size:	241.1 KB 
ID:	156995

    Click image for larger version. 

Name:	image.png 
Views:	4863 
Size:	206.4 KB 
ID:	156996
    Note   Note
    If you have Windows 10 install media on a USB flash drive, you can skip steps 1.1 & 1.2 and use it instead.

    1.3) Create a folder to mount offline image. In this example I use folder C:\Mount.

    1.4) Open elevated PowerShell (tutorial). Enter following command to check what editions are included in image:

    Dism /Get-WimInfo /WimFile:D:\ISO_Files\Sources\install.wim

    Note the index number of your selected edition. In this example I have copied all content of Windows Insider build 16299 to ISO_Files folder. I want to use PRO edition to edit its registry, noting its index number 8:
    Click image for larger version. 

Name:	image.png 
Views:	5196 
Size:	584.9 KB 
ID:	157000

    1.5) Mount the image of your preferred Windows 10 edition using it's index number, index 8 in this example:

    Dism /Mount-Wim /WimFile:D:\ISO_Files\Sources\install.wim /index:8 /MountDir:C:\Mount

    This will take some time. Please notice, the drive where the Mount folder is located needs some free space. I do not recommend mounting an image to a folder on a drive with less than 15 GB free space. For instance, mounting the multi edition build 16299.15 image requires almost 12 GB, in addition to space required to work with the image:
    Name:  image.png
Views: 4530
Size:  108.7 KB



    DISM - Edit Registry on an Offline Image Step Two DISM - Edit Registry on an Offline Image
     Edit Offline Registry
    2.1) To be able to edit offline registry, offline registry hive you want to modify needs to be imported to a temporary hive in your host registry. In this example I will import HKLM\Software hive from offline registry to a temporary hive named OFFLINE in host registry:

    reg load HKLM\OFFLINE C:\Mount\Windows\System32\Config\Software

    Above command creates a new hive HKLM\OFFLINE in host registry importing HKLM\SOFTWARE hive from offline image to it. Replace the imported hive name with one you want to import, for instance the following command would import hive SECURITY from offline image:

    reg load HKLM\OFFLINE C:\Mount\Windows\System32\Config\Security

    You can import SOFTWARE, DEFAULT, DRIVERS, SAM or SYSTEM hives.

    2.2) Open Registry Editor (regedit) on host, you will notice it now contains temporary hive HKLM\OFFLINE:
    Name:  image.png
Views: 4541
Size:  151.9 KB

    2.3) Edit registry settings in temporary hive as you wish. See a practical example in this post: Add or Remove Internet Explorer Desktop Icon in Windows 10 Browsers Email Tutorials



    DISM - Edit Registry on an Offline Image Step Three DISM - Edit Registry on an Offline Image
     Commit (save) changes
    3.1) When done with registry edits, unload temporary hive with following command:

    reg unload HKLM\OFFLINE

    This removes temporary hive from host registry

    3.2) Unmount offline image committing (saving) changes with following command:

    Dism /Unmount-Image /MountDir:C:\mount /Commit

    The /Commit switch takes care of saving all changes to install.wim file.

    3.3) If you were using Windows image on a USB drive, you are done. You can now install Windows 10 which by default contains changes you've made.

    3.4) If you were using image copied from an ISO image to ISO_Files folder, you can now create a new ISO using your preferred tool (Rufus for instance), or as told in Part Five in this tutorial: Create Windows 10 ISO image from Existing Installation Installation Upgrade Tutorials

    That's it geeks!

    Kari


  1.    3 Weeks Ago #1

    Hello Kari. Do you need to commit changes after modifying each hive? Or can you unload one hive then import another before committing the changes?

    I started with the "Software" hive and want to modify "System"

    My guess is multiple hives can be loaded and unloaded one by one, then all the changes can be saved.

    Thanks for the work on this tutorial.
    Last edited by Barefoot; 3 Weeks Ago at 13:45.
      My ComputerSystem Spec


  2. Posts : 14,413
    Windows 10 Pro
    Thread Starter
       3 Weeks Ago #2

    You can import one hive at the time, then commit changes when you have edited all hives.

    Kari
      My ComputerSystem Spec

  3.    2 Weeks Ago #3

    I started with the HKLM\Software hive, and it loaded fine. When I attempted to load HKLM\System, access was denied. Click image for larger version. 

Name:	2018-08-01_20h07_37.png 
Views:	11 
Size:	128.1 KB 
ID:	198023

    Second question. Can hives other than HKLM be modified?
    I'd like to remove the shortcut name extension by going to HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer, and modifying the link BINARY to 00 00 00 00 = off, then HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\NamingTemplates, and deleting the ShortcutNameTemplate string value.
      My ComputerSystem Spec


  4. Posts : 436
    trying to install win10
       2 Weeks Ago #4

    You have given them both the same name.OFFLINE.

    I suggest in future you load software hive as the name SOFT
    REG LOAD HKLM\SOFT F:\MOUNTBOOT\WINDOWS\SYSTEM32\CONFIG\SOFTWARE

    then load system hive as the name SYS
    REG LOAD HKLM\SYS F:\MOUNTBOOT\WINDOWS\SYSTEM32\CONFIG\SYSTEM

    For now, as you have loaded software hive as the name OFFLINE

    You are ok to load system hive as the name SYS.
      My ComputerSystem Spec

  5.    2 Weeks Ago #5

    Thanks. Good suggestion. I wondered if the name should be changed. Your naming suggestion makes identifying where you are in the registry easier.

    I'm still curious if changes can be made to HKEY_CURRENT_USER. Powershell only allows loading HKLM and HKU.
      My ComputerSystem Spec


  6. Posts : 177
    Microsoft Windows 10 x64
       2 Weeks Ago #6

    thanks kari, you make everything easy
      My ComputerSystem Spec


  7. Posts : 436
    trying to install win10
       2 Weeks Ago #7

    Not clear what you are trying to do. There is no HKCU hive. That is key on your currently running system. It is a combination of the user settings in %userprofile%\ntuser.dat and links to HKLM\Software.

    If you are trying to adjust user settings on the installation media - load users\administrator\ntuser.dat and users\default\ntuser.dat from the installation media. The ntuser.dat files are hives.

    Regedit allows you to load hives under the HKLM or HKU keys.

    Barefoot said: View Post
    Thanks. Good suggestion. I wondered if the name should be changed. Your naming suggestion makes identifying where you are in the registry easier.

    I'm still curious if changes can be made to HKEY_CURRENT_USER. Powershell only allows loading HKLM and HKU.
    Last edited by SIW2; 2 Weeks Ago at 13:32.
      My ComputerSystem Spec


  8. Posts : 436
    trying to install win10
       2 Weeks Ago #8

    Kari,
    I am not convinced powershell is the best way to do this. It is reliant on netframe, slow, and creates handles to the keys which can be difficult when unloading.

    I would suggest using regedit directly, or via cmd prompt. If you want to do it via script, .cmd using reg.exe is probably easier.
      My ComputerSystem Spec


  9. Posts : 19,453
    windows 10 professional version 1607 build 14393.969 64 bit
       2 Weeks Ago #9

    What options if any are there when using a windows 10 iso and winre?

    For example in winre running the command: sfc /scannow /offbootdir=d:\ /offwindir=d:\windows
    may display
    windows resource protection could not start the repair service
    or
    windows resource protection found corrupt files but was unable to fix some of them.

    If the log file displays problems in the registry what options are there to troubleshoot in winre?
      My ComputerSystem Spec


 
Page 1 of 2 12 LastLast

Tutorial Categories

DISM - Edit Registry on an Offline Image Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Xbox Windows Phone


Related Threads
Can anybody tell me how to modify the registry on a mounted wim? I keep getting Access denied. This is the command I am using: reg load hkey_local_machine\software c:\test\offline\windows\system32\config\software We have Windows 10 64 bit...
Hello my windows 10 laptop was being fixed by a agent through remote control access they asked me to delete a USB driver folder in my registry upon restarting my log in has been missing the restore and reset options fail but recognize a key is...
I have already inquired about this in the past, but I can't seem to get a response from anyone. I would really appreciate some help with this please :). In order to customize which fields/properties are displayed in the tooltips for any given...
Cant Edit or Write to Registry in Performance & Maintenance
I have been working with windows 10 X64 PRO for a little bit now. I can still not figure out why my scripts (.vbs) or .exe that I push to or use on my domain machines will not edit or create keys in the registry. The only way i can do it is to full...
Hello I have a laptop that I took the HDD out of and connected it to another Windows 10 machine. I ran the command Dism /Image:e:\ /Cleanup-Image /RestoreHealth but get the error Deployment Image Servicing and Management tool Version:...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 09:29.
Find Us