Grant Admin rights to an entire registry Hive?

2

There is a way via a CLI or GUI application to grant Admin rights to ALL the keys/Values of an entire registry Hive (like System, SAM, ntuser.dat, etc)?

The problem is that I'm using the Dism tool provided by Microsoft to service and deploy Windows, I'm trying to perform some Dism operations that removes pre-installed packages from a WIM image that I've previouslly mounted, I'm able to remove few packages but for most of them Dism reports me that I have access denied to touch the Hives, so I suppose that to properlly remove some packages Dism needs to update or delete keys from the WIM Hives, then I need to grant Admin rights to those keys!

I normally use SetACL application to grant Admin rights on a single or multiple keys/values of the local Registry, but for a Hive I don't have idea how to.

PS: I've wasted days trying to investigate and search for information but by the moment I didn't find ANY existing information related to how to perform this operation, why?, why there is no (or at least not easy to found) information about this kind of operation over all the World Wide Web?, I'm miss understanding the real problem or doing something wrong?.

This is the command that I'm using:

.\Dism.exe /Remove-Package /PackageName:"(name)" /Image:"(mounted dir)" /English /LogPath:"(file.log)" /LogLevel:"2"

And this is a sample from the log which is full of this kind of Hive Errors:

2014-04-12 04:29:18, Error CBS Only package owners can remove package: Checkpoint-VpnPlugin-Package~31bf3856ad364e35~amd64~es-ES~6.3.9600.16384 [HRESULT = 0x80070005 - E_ACCESSDENIED]

2014-04-12 04:29:18, Info CBS Failed to unload offline registry: {bf1a281b-ad7b-4476-ac95-f47682990ce7}C:/WinMount/Windows/System32/config/SOFTWARE, the client may still need it open. [HRESULT = 0x80070005 - E_ACCESSDENIED]

2014-04-12 04:29:18, Info CBS Failed to unload offline registry: {bf1a281b-ad7b-4476-ac95-f47682990ce7}C:/WinMount/Windows/System32/config/SYSTEM, the client may still need it open. [HRESULT = 0x80070005 - E_ACCESSDENIED]

2014-04-12 04:29:18, Info CBS Failed to unload offline registry: {bf1a281b-ad7b-4476-ac95-f47682990ce7}C:/WinMount/Windows/System32/config/SECURITY, the client may still need it open. [HRESULT = 0x80070005 - E_ACCESSDENIED]

2014-04-12 04:29:18, Info CBS Failed to unload offline registry: {bf1a281b-ad7b-4476-ac95-f47682990ce7}C:/WinMount/Users/default/ntuser.dat, the client may still need it open. [HRESULT = 0x80070005 - E_ACCESSDENIED]

I'm douing all this in a VirtualMachine.

I don't know if it matters but notice that I have granted full Admin rights on all the files and folders of the mounted directory, I can copy/write/delete from system-restricted directories, I mean that seems I don't have any problem with the files rights.

windows-7
windows
windows-8
permissions
windows-registry
asked on Super User Apr 12, 2014 by ElektroStudios • edited Apr 12, 2014 by ElektroStudios

1 Answer

2

What you want to do doesn't work out of the box. You get E_ACCESSDENIED becasue the packages still belong to a Windows Edition. You must kill that dependency first.

There is already a tool out for a while which does all steps for you.

Run install_wim_tweak.exe /p <MountPath> /l to enum all packages. Now run install_wim_tweak.exe /p <MountPath> /c FEATURE /r to kill it.

Example:

install_wim_tweak.exe /p "C:\Mount" /c Microsoft-Hyper-V /r

This kills all Hyper-V related features from the mounted WIM in folder C:\Mount.

answered on Super User Apr 12, 2014 by magicandre1981

User contributions licensed under CC BY-SA 3.0