Take ownership of a file or folder

How to Take ownership of a file or folder from the command prompt

To take ownership of a file or folder run the following commands from a command prompt with elevated privileges.

Right click cmd.exe and select run as, then select the administrator account and provide the password for the administrator.

Change the directory to the directory or file that you need to regain permissions on.

How to take ownership of files using the command prompt :
TAKEOWN /F <filename>

Now run the following command to assign the administrators group full control of the file

ICACLS <filename> /grant administrators:F

How to take ownership of folders using the command prompt :
takeown /f <foldername> /r /d y

Now assign the administrators group full control of the folder by running the following command : 
icacls <foldername> /grant administrators:F /T

  • ownership, take ownership, command prompt, files, folders, windows server
  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

Windows Update Error 80244019

If you receive the error 80244019 when attempting to get Windows Update to check for available...

Unable to RDP to Windows Server - An Authentication Error Has Occurred CredSSP Encryption Oracle Remediation

You receive the error below when attempting to remote desktop (RDP) into a Windows Server running...