Showing posts with label How to change file or folder ownership in window 7. Show all posts
Showing posts with label How to change file or folder ownership in window 7. Show all posts

How to Take Ownership of a File, Folder Using Command-line in Window 7 and Vista

Taking ownership of a file

Click Start, click All Programs, click Accessories, right-clickCommand Prompt, and then click Run as Administrator.
Type the following command and press ENTER:  TAKEOWN /F<filename>
(Replace the text <filename> 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 <filename> /grant administrators:F