Normally, taking ownership of a system file or folder can be a bit of a pain, taking numerous steps that can be a major inconvenience. If you do a great deal of tweaking to your system, you are bound to run into an instance where you need to take ownership of a system file to accomplish the tweak. By adding a Take Ownership command to the Explorer context (right-click) menu you will make taking ownership of a file a piece of cake.
1. Open Notepad.
2. Copy and paste the following into the new text document:
Windows Registry Editor Version 5.00
[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"
3. Save the document as TakeOwnership.reg.
4. Merge the new file into the registry by right-clicking it, selecting Merge.
5. Continue through the UAC prompt and confirm that you wish to perform the action.