Search Tools Links Login

Add Take Ownership to Right-Click Menu


To take ownership of a file or directory, you'd normally right click the object, select properties, open the security tab, click advanced, open the owner tab, select a new owner, then click apply.

With this handy little registry edit, you can add the "Take Ownership" option to the right click context menu, saving time and mouse clicks.

Be mindful of line wrapping on the longer lines below.

[HKEY_CLASSES_ROOT\*\shell\runas]
@="Take Ownership"
"Extended"=""
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\*\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"

[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="Take Ownership"
"Extended"=""
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"

About this post

Posted: 2009-01-22
By: FortyPoundHead
Viewed: 2,677 times

Categories

Tip

Software Hack/Tweak

Windows

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.