Add Take Ownership Option to Right-Click Menu

by Eric Geier [Published on 8 Feb. 2012 / Last Updated on 8 Feb. 2012]

Quickly change ownership of a file or folder to the current logged on user.

The takeown command can be used in the Command Prompt to take ownership of a file or folder even when access is denied. However, if you need this periodically you can add a shortcut to the right-click context menu with a registry edit. Then you’d just have to right-click a file or folder while holding down the Shift key and then select “Take Ownership”.

Open Notepad, insert the following text, and save as Ownership.reg:

Windows Registry Editor Version 5.00
@="Take Ownership"
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
@="Take Ownership"
@="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"

Then to apply, execute the Ownership.reg file.

See Also

The Author — Eric Geier

Eric Geier (Dayton, Ohio) is a Freelance  Tech Writer and Author specializing in computer networking. He's also the Founder and Owner of NoWiresSecurity, which provides a hosted cloud-based RADIUS service to help businesses easily secure their Wi-Fi networks with the Enterprise (802.1X) mode of WPA/WPA2 security. He’s also the Founder and Owner of On Spot Techs, which provides on-site computer and technology services.

Featured Links