We saw how to Take Ownership of a file or folder using the takeown.exe command-line tool. You can add the “Take Ownership” command to the right-click menu to make it easier to access.
Add “Take Ownership” to the right-click menu
Download take_ownership_context_menu.zip, unzip the file, and run the enclosed REG file. Click Yes to confirm.
This adds the “Take Ownership” command to the right-click menu for files and folders.
To access the menu item, press Shift and right-click on a file or folder. Click “Take ownership”. For folders, the command takes ownership and assigns permissions recursively (i.e., for the current folder, files, subfolders, and all files in the subfolders.)
After the command completes execution, you can see the results in the Command Prompt window.
Contents of the REG file
Windows Registry Editor Version 5.00
;Add Take Ownership command to the context menu
;Take ownership of a file/folder, and provide "Administrators" group Full Control permissions.
;For Windows Vista, 7, 8, 8.1, 10 and Windows 11.
[-HKEY_CLASSES_ROOT\*\shell\runas]
[HKEY_CLASSES_ROOT\*\shell\runas]
@="Take Ownership"
"Extended"=""
"HasLUAShield"=""
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\*\shell\runas\command]
@="cmd.exe /k takeown /f \"%1\" && icacls \"%1\" /grant *S-1-5-32-544:F"
[-HKEY_CLASSES_ROOT\Directory\shell\runas]
[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="Take Ownership"
"Extended"=""
"HasLUAShield"=""
"NoWorkingDirectory"=""
"AppliesTo"="NOT (System.ItemPathDisplay:=\"C:\\Users\" OR System.ItemPathDisplay:=\"C:\\ProgramData\" OR System.ItemPathDisplay:=\"C:\\Windows\" OR System.ItemPathDisplay:=\"C:\\Windows\\System32\" OR System.ItemPathDisplay:=\"C:\\Program Files\" OR System.ItemPathDisplay:=\"C:\\Program Files (x86)\")"
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /k takeown /f \"%1\" /r /d y && icacls \"%1\" /grant *S-1-5-32-544:F /t /c"
That’s it. It’s much easier now to take ownership of a file or folder without manually opening the admin Command Prompt window every time.
One small request: If you liked this post, please share this?
One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!