Subinacl Access Denied using subkeyreg

4

0

I have windows 7 x86, I am the only user and Administrator of my pc. I want to be able to take ownership of the key(below) but subinacl will not allow it.

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\USBSTOR

The error is: RegSetKeySecurity Error: 5 Access is denied.

I've tried to launch it with an elevated command line and it still says error 5.

Two question: Why is it doing this? How to take ownership of this key? I would like to use subinacl if possible. But I am open minded to other tools as long as they can be used from the command line.

TwirlMandarin

Posted 2012-07-13T23:54:56.740

Reputation: 1 510

Why do you need to take ownership of that key? – None – 2012-07-14T00:30:51.510

@Randolph West I want to delete every subkey within it but it won't let me. Besides, I want to know why it doesn't work. It works if set the permissions manually from regedit. – TwirlMandarin – 2012-07-14T00:36:44.880

@AlexanderCeed, did you run subinacl from an admin command-prompt? – Synetech – 2012-07-14T00:50:45.307

@Synetech Yes. I right click on cmd.exe and select "Run as admin" – TwirlMandarin – 2012-07-14T01:09:48.287

Answers

0

Use the commands below with SetACL with administrative privileges:

set X="HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\USBSTOR"
SetACL.exe -on %X% -ot reg -rec cont_obj -actn setowner -ownr "n:Everyone"
SetACL.exe -on %X% -ot reg -rec cont_obj -actn ace -ace "n:Everyone;p:full"

Biswapriyo

Posted 2012-07-13T23:54:56.740

Reputation: 6 640

0

You have to take ownership of the registry key before you can change its permissions (you should set the ownership back afterwards).

Hmm, I could have sworn you can use the takeown command to take ownership of a registry key, but it looks like you can’t.

Instead, depending on the version of Windows you use you can use the cacls command, icacls, or xcalcs (update with a VB script), or even a third-party tool like RegDACL.

(cacls and icacls come with Windows 7)

Synetech

Posted 2012-07-13T23:54:56.740

Reputation: 63 242