/
/

How to Add “Take Ownership” to the Context Menu in Windows

How to Add 'Take Ownership to the Context Menu in Windows blog banner image

Taking ownership of a file or folder in Windows means becoming its primary controller. It allows you to assume full control over files or folders that are restricted due to permission settings.

In this guide, we will walk you through the straightforward ways on how to add a “Take Ownership” option to the right-click context menu in Windows 10 and 11. This is particularly useful if you’ve been encountering some common ownership issues, such as needing to modify system files for troubleshooting but can’t, accessing files from an old Windows installation, or inheriting files from another system and lacking the necessary permissions.

How to take file ownership in Windows 10

The simplest way to add “Take Ownership” to the right-click context menu in Windows 10 and 11 is by modifying the Windows Registry.

Step 1: Open the Registry Editor

  1. Simultaneously press Win + R to open the Run dialog box.
  2. Type regedit and press EnterOpen Run dialog box and type Regedit

Step 2: Navigate to the Context Menu Registry Key

  1. In the Registry Editor, navigate to the following key: HKEY_CLASSES_ROOT\*Registry window navigate to : HKEY_CLASSES_ROOT\*
  2. For adding the option to folders instead of files, navigate to: HKEY_CLASSES_ROOT\DirectoryRegistry Editor window and navigate to : HKEY_CLASSES_ROOT\Directory

Step 3: Create a new registry entry

  1. Right-click on the shell key inside the selected path.
  2. Choose New > Key and name it TakeOwnership. Registry Editor window, Right-click on the shell key inside the selected path and Choose New > Key.
  3. Inside TakeOwnership:
    1. Create a new String Value named “MUIVerb”
    2. Set its value to Take Ownership.
  4. Create another String Value named “Icon” and set its value to imageres.dll, -78 (This is an optional step intended to modify the icon display).
  5. Create a new key inside TakeOwnership and name it command.
  6. Set the Default value of command to the following:
    • cmd.exe /c takeown /f “%1” /r /d y && icacls “%1” /grant administrators:F /t /c /l /q
  7. Close the Registry Editor.

Step 4: Restart Windows Explorer

  1. Open Task Manager.
  2. Locate Windows Explorer in the Processes tab.
  3. Right-click the process and select Restart.
  4. Right-clicking a file or folder should display the “Take Ownership” option.

How to remove “Take Ownership” from the context menu

Despite its many advantages, taking ownership of files and folders is not always safe. This is why the default option in all Windows devices is to limit permissions to maintain system integrity and user privacy. It makes sense when you consider that granting ownership rights too easily can lead to accidental system modifications.

Adding “Take Ownership” to the context menu grants multiple users to have access to a system. While this can improve collaboration, it also increases the risk of someone misusing the feature.

To remove Take Ownership from the context menu:

  1. Open the Registry Editor by prompting the regedit command through the Run dialog box.
  2. Navigate to the “HKEY_CLASSES_ROOT\*\shell\TakeOwnership” key.
  3. Right-click on the TakeOwnership key and select Delete.
  4. Confirm deletion.
  5. Restart Windows Explorer, as described in the previous instructions.

Alternative methods to take ownership of files

There are three other ways to take full ownership of files. While we will describe them below, be aware that the Windows Registry option is still the most efficient way to perform this action. That said, if you encounter problems with that option, there are other methods to consider:

Option 1: Using Command Prompt

⚠️ Note: Make sure that you open Command Prompt as an Administrator. Even so, there are some operations that even an Admin cannot carry out in its entirety.

  1. Open Command Prompt.
  2. Type the following command:
    •  takeown /f foldername /r /d y (Replace foldername with the specific folder you want to take ownership of.)
  3. Run the command: 
    • if you only want to give ownership to a specific user in the system, the command is: icacls foldername /grant %username%:F /t /q 
    • If you want to give full permission to the Administrator, the command would be: icacls full_folder_path /grant administrators:F /t 

Option 2: Using PowerShell

To take ownership using PowerShell, use the following command.

    • takeown /f “C:\Path\To\Your\FileOrFolder” /r /d y 

Replace FileOrFolder with the specific file path.

You can also use access control lists (ACLs) in Windows to define permissions attached to files. PowerShell provides the cmdlets “Get-ACL” and “Set-ACL” to manage these lists.

  1. Retrieve the current ALC: $acl = Get-ACL “C:\path\to\your\file.txt”
  2. State the new owner with the following command. Replace YourDomain \YourUsername with the relevant information.
    • $principal = New-Object System.Security.Principal.NTAccount(“YourDomain\YourUsername”)
  3. Set the new owner:
    • $acl.SetOwner($principal)
    • Set-Acl “C:\path\to\your\file.txt” $acl

To take ownership of multiple files, you would use the ‘ForEach-Object’ cmdlet. For example, if you want to take ownership of all files within a folder, you would execute the command:

    • Get-ChildItem “C:\path\to\your\folder” | ForEach-Object { takeown /f $_.FullName }

Option 3: Changing folder properties

  1. Go to the desired file or folder and right-click on it.
  2. Select Properties.
  3. Go to Security tab, and click the Advanced button. Go to any Desired file or folder and right-click on it. Select Properties. Go to Security tab, and click the Advanced button.
  4. Click on the Change button next to Owner. This will open a new window. Click on the Change button next to Owner
  5. Write Administrator in the Enter the object names to select form, and then click on Check Names. Press Ok to proceed.
    ⚠️ You should see the Owner changed to the initial name of your administrative account. 
  6. Click on Replace owner on sub containers and objects, then Apply. End by pressing Ok. You should receive a notification once ownership has been changed. Simply press Ok to close this window.

Troubleshooting issues with taking ownership

Occasionally, you will encounter issues when taking ownership of the context menu in Windows. This usually occurs when you use other methods aside from the Windows Registry. Below are some common issues you may experience, with suggested solutions.

Issue: “Access Denied” even after taking ownership

This issue occurs when ownership alone does not grant full permissions. After taking ownership, make sure that you explicitly grant yourself Full Control in the Security tab. If this still doesn’t work, try opening the file or folder using Safe Mode. Check out this guide, How to Start Safe Mode with Windows Command Prompt, for more information.

Issue: “Take Ownership” option is missing from the context menu

If you cannot see the “Take Ownership” option after following the modification steps, try restarting Windows Explorer or your device itself. This applies the changes to your device. If this still doesn’t resolve the issue, check for system policy restrictions that may prevent changes to the context menu.

Issue: File is still locked after taking ownership

This happens when files or folders are actively used by Windows processes. To resolve this, reboot your computer in Safe Mode and attempt changes. In the worst-case scenario, you may have to perform a system restore to revert to default configurations; however, keep in mind that a full system restore will affect all changes, including those that are working.

Best practices for managing file ownership

Only modify system files when necessary

System defaults are defaults for a reason. Changing system file ownership without proper justification can lead to potential security vulnerabilities.

Always create backups

As a redundant layer, make sure that you back up your files before modifying file permissions. This is a crucial action to take, especially for business-critical files.

Be selective when applying “Take Ownership”

Take particular care when applying “Take Ownership” to multiple files – especially if you are using PowerShell or Command Prompt. This can lead to unintended behavior.

Check for running processes

Take note that Take Ownership may not work if a file is actively being used.

Restore permissions when finished

If you are only taking ownership for troubleshooting purposes, make sure to revert to default settings once you’re finished.

Frequently Asked Questions (FAQs)

Does taking ownership affect system security?

Yes, especially if you change permissions on critical system files. Even with the best solutions, consider that some files are protected for a reason. Unless you absolutely need to take ownership, modifying files can accidentally leave your system vulnerable to threat actors.

Can I take ownership of system files without affecting Windows updates?

Taking ownership of system files can sometimes affect Windows updates, as the system expects default permissions to remain intact. It’s a good idea to revert permissions on critical system files to minimize the risk of faulty updates.

What happens if I take ownership of an entire drive?

It is never recommended to take ownership of an entire drive. Doing so can lead to unintended access control issues, especially if system files and application data are affected. We recommend doing this only for troubleshooting and reverting to default permissions once done.

Can I use this method on external drives or network folders?

Yes, but with limitations. You can take ownership of files on external drives as long as they are formatted with NTFS. This is because FAT32 and exFAT do not support Windows ownership and permissions. For network folders, taking ownership may not work if the files are managed by a different system of domain administrators. For such cases, permission changes need to be made on the host system.

How do I restore default permissions after taking ownership?

To restore default permissions, you need to reset the original owner and access control settings. You can follow the instructions as listed above for more information.

The importance of “Take Ownership”

There are specific use cases when you must take file ownership in Windows 10, such as troubleshooting files. The process is straightforward, but keep in mind that there are security risks involved. It is always a good practice to revert to default permissions once you’ve accomplished your intended purpose.

You might also like

Ready to simplify the hardest parts of IT?
×

See NinjaOne in action!

By submitting this form, I accept NinjaOne's privacy policy.

NinjaOne Terms & Conditions

By clicking the “I Accept” button below, you indicate your acceptance of the following legal terms as well as our Terms of Use:

  • Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms.
  • Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party.
  • Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library belonging to or under the control of any other software provider.
  • Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations.
  • Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks.
  • Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script.
  • EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).