Friday, October 25, 2024
HomeWindowsWindows 7Windows 7: How to Easily Take Ownership of a System File or...

Windows 7: How to Easily Take Ownership of a System File or Folder

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.

Rob Rogers
Rob Rogers
Once a prolific author here on Tech-Recipes, Rob has moved on to greener pastures.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

LATEST REVIEWS

Recent Comments

error: Content is protected !!