Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
Why do you need to take ownership of that key? –  user3463 Jul 14 '12 at 0:30
    
@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. –  Alexander Ceed Jul 14 '12 at 0:36
    
@AlexanderCeed, did you run subinacl from an admin command-prompt? –  Synetech Jul 14 '12 at 0:50
    
@Synetech Yes. I right click on cmd.exe and select "Run as admin" –  Alexander Ceed Jul 14 '12 at 1:09
add comment

1 Answer

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)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.