Home » Questions » Computers [ Ask a new question ]

What is the syntax to use "takeown.exe" on a registry key?

What is the syntax to use "takeown.exe" on a registry key?

Simple question, but how do you do it?

Asked by: Guest | Views: 146
Total answers/comments: 1
Guest [Entry]

"I believe takeown.exe for taking ownership of a file, not for Registry keys.

C:\Users\Sathya>takeown /?

TAKEOWN [/S system [/U username [/P [password]]]]
/F filename [/A] [/R [/D prompt]]

This tool allows an administrator to recover access to a file that
was denied by re-assigning file ownership.

By executing

takeown /f //HKEY_LOCAL_MACHINE/MyKey/ \R \A

You're saying take ownership of file located at network location HKEY_LOCAL_MACHINE with share name of MyKey, which is not the way registry keys are stored.

Also, \R and \A should be specified with forward slashes, not backslashes, ie, /R /A

To take ownership of registry key,

Open Registry Editor.

Click the key you want to take ownership of.

On the Edit menu, click Permissions.

Click Advanced, and then click the Owner tab.

Under Change owner to, click the new owner, and then click OK.

To do so via an external program you'll need an App like RegDACL

What is RegDACL good for? RegDACL
allows you to query and change the
discretionary access control list
(DACL) of any Windows NT Registry key.
You can of course use the program
RegEdt32 to set registry permissions,
but if you need to edit more than a
few machines then you are faced with
quite a boring job, not to mention
being more prone to make mistakes.
RegDACL gives you the ability to use a
batch script to perform this job. The
freeware versions of RegDACL allow you
to define access permissions for the
predefined groups"