This article shows how to add the “Take Ownership” option to your right-click menu in Windows Vista.
Note: By editing the registry it is possible to do unrecoverable damage to your PC, if you are not confident in editing the registry, do not try this.
First is to create a registry file using Notepad. Start > All Programs > Accessories > Notepad and to copy and paste the following:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\runas]
@=“Take Ownership”
“Extended”=””
“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”
“Extended”=””
“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”
Save the file and call it Ownership.reg. Close Notepad and double click the file ownership.reg, You will need to click Continue to have access granted (unless you have UAC disabled). Click Yes at the registry editor security prompt, and click OK after the file has been successfully added to the registry.
Now when you hold Shift+Right Click on a file or folder Take Ownership will be an option in the menu, use that to change ownership of files and folders, you will need to click Continue to have access granted.
To verify the change of ownership on the file or folder, Right Click and choose Properties > Details > Look at the Owner, Computername\Username. And there you have it.
When migrating files and folders to Vista you may find that you don't have access to those folders and files, this happens because the user has lost ownership and no longer has the required permission to access the folders or files. If you can not delete, open or change the files and folders because of this it means you need to take ownership and change permission. Both operations can be done from the same menu, here is how to.
To Change Ownership:
Navigate to the file or folder you need to work with Right Click it and choose > Properties > Security tab > Advanced. The next window will show you the current Owner of that file or folder, Click Edit if your user is not the owner > (if UAC is enabled click Ok or Continue to elevate your privilages so that the task can be performed) > In the Owner window > click on Other Users and Groups > Here you type the Username or Group that you want to take control of the file or folder. Choose Administrator if you want all Administrators on the computer to have Ownership, or choose your own Username so you have Ownership > When that is done click on Check Names > if the Username or Group was found you'll see the text typed is changed to [Your PC Name]\[User] or [Your PC Name]\[Group] > if all is correct Press Ok. If the error Name Not Found appears make the necessary changes to correct it. The next step is in the Owner window > select the User or Group you added > select select Replace Owner on Subcontainers and Objects > click Ok > you now should receive conformation that you have taken Ownership of the said file or folder > click Ok.
To Change Permissions:
You now go back to the Properties window > Security tab > Click on Edit > If your Username or Group are not in the list click Add > if you are on the list Select it > Click on Allow Full Control > click Ok > Here type the Username or Group that you want to change the permissions for, type Administrator if you wish to give all Administrators the permissions, or Type your Username to give permission to > click Check Names > click Ok > if the error Name Not Found appears, go back and make the necessary changes. In the Security Tab > Select the Username or Group you just added > click on Allow Full Control > click Ok. And that should be it, you can now delete, change or edit the files and folders that were formerely not accessable. Print this out if it helps.