Memorise

Taking ownership of a file

Taking ownership of a file
Open an elevated Command Prompt window. To do so, click Start, click All Programs, click Accessories, right-click Command Prompt, and then click Run as Administrator.

Type the following command and press ENTER:

TAKEOWN /F
(Replace the text
with the full path of the actual file.)

If the operation was successful, you should see the following message:

“SUCCESS: The file (or folder): “filename” now owned by user “Computer Name\User name”.”

Then to assign the Administrators group Full Control Permissions for the file, you may use the ICACLS command. Use this syntax:

ICACLS /grant administrators:F
Taking ownership of a folder
Use the following syntax:

takeown /f /r /d y
Then to assign the Administrators group Full Control Permissions for the folder, use this syntax:

icacls /grant administrators:F /T
The /T parameter is added so that the operation is carried out through all the sub-directories and files within that folder.

Command-line help: To know more information about the above commands, run these commands from a Command Prompt window.

takeown /?

icacls /?


Categorised as: Microsoft, Networking, Server OS


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.