Add “Take Ownership” To The Explorer Right-Click Context Menu

Installation
Create a new text file and name it TakeOwnership.reg

Contents:

Windows Registry Editor Version 5.00
 
[HKEY_CLASSES_ROOT*shellrunas]
@="Take Ownership"
"NoWorkingDirectory"=""
 
[HKEY_CLASSES_ROOT*shellrunascommand]
@="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_ROOTDirectoryshellrunas]
@="Take Ownership"
"NoWorkingDirectory"=""
 
[HKEY_CLASSES_ROOTDirectoryshellrunascommand]
@="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"

Uninstallation
Create a new text file and name it RemoveTakeOwnership.reg

Contents:

Windows Registry Editor Version 5.00
 
 
[-HKEY_CLASSES_ROOT*shellrunas]
 
[-HKEY_CLASSES_ROOTDirectoryshellrunas]
%d bloggers like this: