Taking ownership of files or folders in Windows can be troublesome through GUI and command line. Users can take control of files or folders without going through multiple steps by adding the “Take Ownership” option to the right-click menu in Windows Explorer. Why do you need to “Take Ownership” of files or folders in Windows? …
Taking ownership of files or folders in Windows can be troublesome through GUI and command line. Users can take control of files or folders without going through multiple steps by adding the “Take Ownership” option to the right-click menu in Windows Explorer.
In Windows, the owner of a file or folder has the right to modify its permissions and can always access it, even if other permissions contradict that access. You may need to take ownership of a file or folder in some situations. For example, you might need to modify a system file like replacing Notepad with another text editor, typically owned by “Trusted Installer” by default. Alternatively, you might need to access and control files from a hard drive connected to another computer. By editing the Registry, you can “Take Ownership” without going through the complex process of using the permissions dialog boxes in Windows or the Command prompt.
Note: The technique in this article works in Windows 7, 8, and 10.
Standard warning: Registry Editor is a powerful tool and misusing it can render your system unstable or even inoperable. This is a pretty simple hack and as long as you stick to the instructions, you shouldn’t have any problems. That said, if you’ve never worked with it before, consider reading about how to use the Registry Editor before you get started. And definitely back up the Registry (and your computer!) before making changes.
Below is how you manually add the “Take Ownership” functionality via the Registry Editor (regedit). This method does not require coding experience, but please do heed the warning above and make sure you have a backup plan in case you make a mistake. Now with that said, let’s begin!
Step 1: Open Registry Editor: Go to “Start” and type “regedit.”
Step 2: Navigate to Keys for Files:
HKEY_CLASSES_ROOT\*\shell
Right-click on shell key > New > Key and name it “runas.”
Double-click on the “Default” value and type “Take Ownership” in the Value Data box.
Create a new string value in the runas key: Right-click on runas key > New > String Value and name it “NoWorkingDirectory.”
Create a new key under the runas key: Right-click on runas key > New > Key and name it “command.”
In the Command key, double-click on “Default” value
Type “cmd.exe /c takeown /f \”%1\” && icacls \”%1\” /grant administrators:F” in the Value Data box.
Create a new string value in the Command key: Right-click on Command key > New > String Value and name it “IsolatedCommand.”
Double-click on “IsolatedCommand” value > type “cmd.exe /c takeown /f \”%1\” && icacls \”%1\” /grant administrators:F” in the Value Data box.
And that’s it! You should now be able to right-click on a file and use the “Take Ownership” functionality on your computer.
Another way to add the “Take Ownership” functionality is via folders and using the file system in the Registry Editor. Our warning above still applies: make sure you have this backed up before you start changing it, or have a backup of your whole computer. Now let’s take a look at this method:
Step 1: Navigate to Keys for Folders:
HKEY_CLASSES_ROOT\Directory\shell
Right-click on shell key > New > Key and name it “runas.”
Double-click on the “Default” value and type “Take Ownership” in the Value Data box.
Create a new string value in the runas key: Right-click on runas key > New > String Value and name it “NoWorkingDirectory.”
Create a new key under the runas key: Right-click on runas key > New > Key and name it “command.”
In the Command key, double-click on “Default” value
Type “cmd.exe /c takeown /f \”%1\” /r /d y && icacls \”%1\” /grant administrators:F /t.”
And there you have it, two ways to add “Take Ownership” to your right-click functionality on your PC.
That is it! If you’re having any trouble, please contact your system administrator or IT professional or restore your backup regedit files and try again.