Take Ownership/Permissions

In this article I’ll explain how to get permissions to modify/replace a protected system file. We will use authui.dll as an example. You can do this either via the GUI or via the Command Line. If you have problems with permissions, check the Troubleshooting section or ask your question at the forum. Remember: always make a backup before modifying/replacing system files!

GUI

The first 3 steps help you to get ownership over the file; the last 2 gives yourself permission to edit/replace the file.

Taking Ownership

1. Start Windows Explorer, go to the folder or file you want to get ownership for, right click the file and choose Properties. Now go to the Security tab.

2. In the Security tab click the Advanced button. In the window that opens now go to the Owner tab and click Edit.

3. From the list select the user or group you want to give ownership, click OK and click OK when a notification window appears. Now close all windows by clicking OK.

Setting Permissions

4. Reopen the properties of the file by right clicking the file and choosing Properties. Now go to the Permissions tab again.

5.Click the Edit button and choose in the Permissions window the user you want to edit the permissions from. Check the Full control checkbox if you want to give the selected user all permissions and click OK when you are done. Click Yes when a warning appears about setting the permissions of System folders.

6. Now you have permissions to replace/edit/delete the files or folder you just took ownership of.

Command Line

Start the Command Prompt by clicking Run in the Start menu, entering cmd.exe and clicking OK. Browse to the file or folder you want to set permissions from and use the following commands.

Give ownership of a file to current user

C:\Windows\System32>takeown /F authui.dll
SUCCESS: The file (or folder): “C:\Windows\System32\authui.dll” now owned by user “WIN2008WS\Administrator”.

Give ownership of a file to Administrators group

C:\Windows\System32>takeown /A /F authui.dll
SUCCESS: The file (or folder): “C:\Windows\System32\authui.dll” now owned by the administrators group.

Give ownership of a folder to current user

C:\Windows\System32>takeown /R /F Boot
SUCCESS: The file (or folder): “C:\Windows\System32\Boot” now owned by user “WIN2008WS\Administrator”.
SUCCESS: The file (or folder): “C:\Windows\System32\Boot\en-US” now owned by user “WIN2008WS\Administrator”.
SUCCESS: The file (or folder): “C:\Windows\System32\Boot\winload.exe” now owned by user “WIN2008WS\Administrator”.
<cut for brevity>

Give ownership of a folder to Administrators group

C:\Windows\System32>takeown /R /A /F Boot
SUCCESS: The file (or folder): “C:\Windows\System32\Boot” now owned by the administrators group.
SUCCESS: The file (or folder): “C:\Windows\System32\Boot\en-US” now owned by the administrators group.
SUCCESS: The file (or folder): “C:\Windows\System32\Boot\winload.exe” now owned by the administrators group.
<cut for brevity>

Edit the permissions of the file authui.dll to give full permissions to the Administrator user. Administrator can be replaced by any user or group.

C:\Windows\System32>icacls authui.dll /grant Administrator:F
processed file: authui.dll
Successfully processed 1 files; Failed processing 0 files

Edit the permissions of the Boot folder in C:\Windows\System32\ to give full permissions to the Administrator user. Administrator can be replaced by any user or group.

C:\Windows\System32>icacls Boot /T /grant Administrator:F
processed file: Boot
processed file: Boot\en-US
processed file: Boot\winload.exe
processed file: Boot\winresume.exe
processed file: Boot\en-US\winload.exe.mui
processed file: Boot\en-US\winresume.exe.mui
Successfully processed 6 files; Failed processing 0 files

References:
* Microsoft Technet: Icacls parameters
* Microsoft Technet: Takeown parameters

Troubleshooting

Q: After setting ownership and permissions I still get a You need permission to continue message when modifying files or folders.
A: Try disabling User Account Control (UAC): Start -> Control Panel -> User Accounts -> Turn User Account Control on or off -> uncheck -> OK -> Restart.

Q: How can I restore a file I backed up previously?
A: There are multiple possibilities to do this:

Possibility 1: Safe Mode
1. Go to the boot menu by repeatedly pressing F8 before Windows is loading and select Safe Mode.
2. Remove the edited file and replace it with your backupped file.

Possibility 2: Windows Boot DVD
If your pc couldn’t even boot in Safe Mode, you have to use an external medium to restore the backup file(s).
1. Insert the Windows Server 2008 Installation DVD (download iso) into the dvd drive and boot from it.
2. Click Next at the Language Settings screen.
3. In the next screen choose the Repair your computer link, select the Windows Server 2008 operating system you want to recover from the list and click Next again.
4. At the System Recovery Options screen choose the Commandline Prompt option.
5. Copy the backupped files back to their original location overwriting the edited ones. Reboot your computer when done!

 

  1. Great tutorial! Luckily there is a freeware that can simplify the procedure of taking ownership.
    Try it at:
    http://www.top-password.com/take-ownership-pro.html

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>