Edit registry on a mounted wim


  1. Posts : 49
    Windows 10 Enterprise 64 bit
       #1

    Edit registry on a mounted wim


    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 Enterprise edition.
      My Computer


  2. Posts : 13,898
    Win10 Version 22H2 Pro and Home, Win11 Pro and Home
       #2

    A useful feature of the Enterprise Edition [what companies usually get] is the ability to lock out Users from various aspects which begs the question, could that be getting in your way? Other than that possibility I have no answer.
      My Computers


  3. Posts : 5,478
    2004
       #3

    I do it like this (where $WorkDir is directory where the wim is mounted)
    PHP Code:
    # Registry Changes
    reg load HKLM\WinPE_SYSTEM   $WorkDir\mount\windows\system32\config\SYSTEM
    reg load HKLM
    \WinPE_SOFTWARE $WorkDir\mount\windows\system32\config\SOFTWARE

    $RegKey
    ="HKLM\WinPE_SOFTWARE\Microsoft\NetSh"
    reg add  $RegKey /v wlancfg /t REG_SZ /d wlancfg.dll /
    Can you post the error - what are you not authorized to? Presumably you are running as administrator...
      My Computer


  4. Posts : 49
    Windows 10 Enterprise 64 bit
    Thread Starter
       #4

    I am running as administrator:

    C:\Program Files\Windows AIK\Tools\PETools>dism /mount-wim /wimfile:c:\test\images\64Win10Ent-1511-IHSlogo.wim /index:1 /mountdir:c:\test\offline

    Deployment Image Servicing and Management toolVersion: 6.1.7600.16385

    Mounting image
    [==========================100.0%==========================]
    The operation completed successfully.

    C:\Program Files\Windows AIK\Tools\PETools>reg load hkey_local_machine\software
    c:\test\offline\windows\system32\config\software
    ERROR: Access is denied.
    Last edited by PaulaJava; 05 Sep 2017 at 14:39. Reason: Formatting lost in copy paste from Notepad
      My Computer


  5. Posts : 5,478
    2004
       #5

    You are trying to load your offline image to the existing HKLM\SOFTWARE hive. You can't - you need a new unused name.

    Make up another name like HKLM\WinPE_SOFTWARE and it works fine like this (the name doesn't matter - it just must not already exist):
    Code:
    PS C:\WINDOWS\system32> dism /mount-wim /wimfile:D:\Temp\install.wim /index:1 /mountdir:C:\test\offline
    
    Deployment Image Servicing and Management tool
    Version: 10.0.16281.1000
    
    Mounting image
    [==========================100.0%==========================]
    The operation completed successfully.
    PS C:\WINDOWS\system32> reg load hkey_local_machine\SOFTWARE c:\test\offline\windows\system32\config\software
    ERROR: Access is denied.
    PS C:\WINDOWS\system32> reg load HKLM\SOFTWARE c:\test\offline\windows\system32\config\software
    ERROR: Access is denied.
    PS C:\WINDOWS\system32> reg load HKLM\WinPE_SOFTWARE c:\test\offline\windows\system32\config\software
    The operation completed successfully.
    PS C:\WINDOWS\system32>
    Then update HKLM\WinPE_SOFTWARE or whatever name you chose like this (with whatever you want)
    Code:
    $RegKey="HKLM\WinPE_SOFTWARE\Microsoft\NetSh"
    reg add  $RegKey /v wlancfg /t REG_SZ /d wlancfg.dll /f
    
    $RegKey="HKLM\WinPE_SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost"
    reg add $RegKey /v LocalSystemNetworkRestricted /t REG_MULTI_SZ /d Netman\0hidserv\0svsvc\0dot3svc\0wlansvc /f
    Unload the hive you mounted
    Code:
    reg unload HKLM\WinPE_SOFTWARE
    and unmount the wim (I forget the dism syntax)
    Code:
    # Unmount the WinPE image
    Get-WindowsImage -Mounted -ErrorAction Stop | ForEach-Object {
    	Dismount-WindowsImage -Path $_.Path -Save -ErrorAction Stop
    }
      My Computer


  6. Posts : 8
    WIndow 10
       #6

    Hello

    Can I safely mount my 10 Pro install.wim and remove some apps and make HKCU and HKLM registry changes and use that to upgrade machines via SCCM? Or can this only be used in a clean full install? I have had sucess with an install.wim I removed some of the apps from but none that I have changed some of the registry keys to turn off privacy related setting I get a BSOD

    Thanks
      My Computer


  7. Posts : 49
    Windows 10 Enterprise 64 bit
    Thread Starter
       #7

    Saweet! It mounted successfully. Now I need to figure out the syntax for turning the numlock on at boot up. :)

    Thank you LXO.
      My Computer


  8. Posts : 13,898
    Win10 Version 22H2 Pro and Home, Win11 Pro and Home
       #8

    PaulaJava said:
    Saweet! It mounted successfully. Now I need to figure out the syntax for turning the numlock on at boot up. :)

    Thank you LXO.

    Is it possible the numlock Tutorial [in the Tutorials section of this Forum] would work for your purpose. I find that function works to Save State or if the numlock is On at shutdown it usually be be On at the next start.
      My Computers


  9. Posts : 49
    Windows 10 Enterprise 64 bit
    Thread Starter
       #9

    I was able to make changes in HKLM such as UAC turned off. But I can't seem to be able to load HKEY_USERS\.DEFAULT so I can modify the keyboard and turn on numlock at start up. Any thoughts?
      My Computer


  10. Posts : 52
    Windows 10 Pro 64-Bit
       #10

    Any progress, or still interested? When I tried to load HKEY_Current_USER, Powershell reported it could only load HKLM and HKU. So HKU should work for HKEY_USERS
      My Computer


 

  Related Discussions
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 05:01.
Find Us




Windows 10 Forums