Taking Ownership of Your Files
When you're working in Windows 7, you may have trouble with a folder (or a file) because Windows tells you that you don't have permission to edit (add to, delete, whatever) the folder. You might think the solution is to give your user account Full Control permissions on the folder, but it's not as easy as that. Why not? Because you're not the owner of the folder. (If you were, you'd have the permissions you need automatically.) So the solution is to first take ownership of the folder, and then assign your user account Full Control permissions over the folder.
Here are the steps to follow:
- Use Windows Explorer to locate the folder you want to take ownership of.
- Right-click the folder and then click Properties to open the folder's property sheet.
- Display the Security tab.
- Click Advanced to open the Advanced Security Settings dialog box.
- Display the Owner tab.
- Click Edit.
- In the Change Owner To list, click your user account.
- Activate the Replace Owner on Subcontainers and Objects check box.
- Click OK. Windows 7 warns you that you need to reopen the property sheet to change the folder's permissions.
- Click OK in the open dialog boxes.
- Right-click the folder and then click Properties to open the folder's property sheet.
- Display the Security tab.
- If you do not see your user account in the Group or User Names list, click Edit, click Add, type your username, and click OK.
- Click your username.
- Click the Full Control check box in the Allow column.
- Click OK in the open dialog boxes.
Note that, obviously, this is quite a bit of work. If you only have to do it every once in a while, it's not big thing, but if you find you have to take ownership regularly, you'll probably want an easier way to go about it. You've got it! Listing below shows a Registry Editor file that modifies the Registry in such a way that you end up with a Take Ownership command in the shortcut menu that appears if you right-click any folder and any file.
A Registry Editor File That Creates a Take Ownership CommandWindows 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"
To use the file, double-click it and then enter your UAC credentials when prompted. Rright-clicking (in this case) a folder displays a shortcut menu with a new Take Ownership command. Click that command, enter your UAC credentials, and sit back as Windows does all the hard work for you!
In this tutorial:
- Customizing Windows Explorer
- Returning the Menus to Their Rightful Place
- Changing the View
- Viewing More Properties
- Turning On File Extensions
- Stopping Delete Confirmations
- Running Explorer in Full-Screen Mode
- Exploring the View Options
- Moving User Folders
- Taking Ownership of Your Files
- Running Custom Searches
- Using Natural Language Queries