Microsoft

Easily Take Ownership of Files and Folders in Windows 10 and Windows 7

When denied access to a file or folder in Windows 10 or Windows 7, one of the easiest ways around it is to Take Ownership of the file or folder.

When denied access to a file or folder in Windows 10 or Windows 7, one of the easiest ways around it is to Take Ownership.   This tip comes in handy when you’re dealing with stubborn system files and folders that don’t want to give you access. Normally this is a long process involving several command prompt lines or user interface clicks, but today I’m going to review how to quickly add the Take Ownership option to the Windows right-click context menu for the easiest 1-click access possible.

Add “Take Ownership” to the Windows Context Menu With a Simple Registry Tweak

Step 1

Open the Windows Start menu, type: notepad, and press Enter.

NOTE

Alternatively you can skip straight to Step 4 by just downloading the pre-made registry fix.

Windows 7 screenshot - open notepad

Step 2

Copy and paste the following into the Notepad document:

[HKEY_CLASSES_ROOT\*\shell\runas]
@="Take Ownership"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\*\shell\runas\command]
@="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_ROOT\Directory\shell\runas]
@="Take Ownership"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="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"

Step 3

Save the Notepad file as addownership.reg. Make sure the file name ends with the .reg extension.

Windows 7 screenshot - save as addownership.reg

Step 4

Right-click your new .reg file and select Merge.

You can also double-click the .reg file.

Windows 7 screenshot - merge the registry key fix

Step 5

A warning displays telling you that editing the registry is dangerous.  Click Yes and then click OK on the next confirmation dialog box.

Windows 7 screenshot - continue yes, its safe

Now when you have a file or folder you want to change and you don’t have permission to, you can easily right-click the file or folder and select Take Ownership.  It’s much easier than doing it the long way (which we won’t even get into). Once you have ownership of a file or folder, you can move it, rename it, edit it, or do whatever else you need to do with it.

Windows 7 screenshot - use right click context menu to take ownership of any file in windows 7

Again, you can also add the Take Ownership option to the right-click menu using our pre-made registry fix.


20 Comments

20 Comments

  1. RAW-BERRY  

    Very handy, thanks a ton!

  2. Just to note…. you have funky quotes enabled in your editor for this post. Not sure what that would do if someone tries to import it into the registry, but I’m guessing it would be bad. Your premade download looked good though.

    Thank you for the great post.

    • @James – Thanks for making me aware of that. Something is funky with my CSS so I “fixed” it for now. Will need to update this with a proper insert code plugin or something. Thnx again.

  3. Jill  

    Thank you so much! I jumped from XP to Win7 last week and this was annoying the snot out of me. Windows was locking my public folders in Explorer so I couldn’t move files around easily when transferring to my mp3 player. Fixed!

    • @Jill Excellent! Glad we could help out! Welcome to groovyPost!

  4. Cal  

    Worked great. Thanks for the help.

  5. the Nordic nations of Sweden, Finland, Denmark and Norway grabbed four of the top nine spots –

  6. Shajeev  

    Will this feature be applied only in the profile v create the registry entry?
    or all the users enjoy the sneak?

  7. Joe  

    it didnt work for me, i’m running windows 7 and keep getting message

    “cannot import C:\users\public\downloads\addownership.reg. the specific file is not a registry script. you can only import binary registry files from within the registry editor”

    i put the reg fix on the desktop and started it there and it goes thru the spets to that message

    Is there something i’m missing?

  8. jemile  

    i got the same as Joe

    can anyone help please ???????????

  9. wYNx  

    works great!!

    cheers for this.. :)

  10. Gary  

    It seems like a ‘big project’ when you right clicked ‘takeownership’ on the locked file, the computer ran like mad for few minutes and in the end the name on the locked file which I intended to change still cannot be changed!!!!

    :-(

  11. jewels  

    same binary error msg. any idea next?

  12. Ronnie  

    A billion thanks, I tried following the required permissions route, I was like three hours and still silly padlock on the folder, now it has gone, genius work.

    I LOVE YOU!!!!!!!!!!!!!!!!!!!!!!!!! LOL

  13. Mstee  

    taking ownership did not open the denied access file.

  14. Stefan Miller  

    Thanks for the reg file.
    If you are using the long method (ie: not downloading the file) you must make sure that the text file is changed to .reg and not .txt so should be named

    “addownership.reg”

  15. Diamond INferno  

    If you keep getting that error when trying to merge here is the solution!

    JUST DON’T COPY THE FIRST LINE OF THE TEXT IN THE NOTEPAD.
    It worked for me so if it still doesn’t work I suggest you ask someone who knows more or search on the internet :)

  16. Edano Leo  

    i compared the pre made registry vs the code above. i think the reason the code above doesnt work is because all the “forward slashes” for the directory e.g. [HKEY_CLASSES_ROOT*shellrunascommand] were not present therefore won’t be regonized as a valid registry script. on top of that, you need to exclude both “ ” at the first and last part of the code since it’s a web script.

  17. Beaver  

    8888888888888888888888888888888888888888888888888888888888888

    Notepad cant save it as reg file,yous save as from browser

    8888888888888888888888888888888888888888888888888888888888888

    I was getting the

    “cannot import C:\users\public\downloads\addownership.reg. the specific file is not a registry script. you can only import binary registry files from within the registry editor”
    Then i tried deleting things but got there in the end

    THANKS MR Groove.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

To Top