Home > Commands N-Z > Commands T


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Allows an administrator to recover access to a file that previously was denied by making the administrator the owner of the file.


TAKEOWN [/A] [/D {Y | N}] /F [share_name\]file_name [/R] [/S computer [/U [domain\]user [/P [password]]]]



/A (NT2003)
Gives ownership to the administrators group instead of the current user.
If omitted, file ownership is given to the user who is currently logged on to the computer.
/D {Y | N} (NT2003)
Default prompt used when the current user does not have permissions to view folders within a directory:
/F [share_name\]file_name (NT2003)
Specifies the file name or directory name pattern. You can use the wildcard character "*" in specifying the pattern.
Mixed patterns using the question mark (?) and the wildcard character (*) is not supported.
/R (NT2003)
Performs recursive operation on all files in the specified directory and subdirectories.
/P password (NTXP)
Specifies the password of the user account that is specified in /u.
/S computer (NTXP)
Specifies the name or IP address of a remote computer (do not use backslashes). The default is the local computer.
/U [domain\]user (NTXP)
Runs the command with the account permissions of the user specified by User or Domain\User. The default is the permissions of the current logged on user on the computer issuing the command.




To perform this procedure, you must be a member of the Administrators group on the local computer, or you must have been delegated the appropriate authority. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure.

If you install a Windows Server 2003 operating system on a computer with another Windows Server 2003 operating system already installed and then attempt to delete it, you cannot delete the entire directory. One of the hidden directories, named \Installer, contains some .msi and .ico files that are locked, and you have to format the drive to delete them. This is because the Windows Server 2003 operating systems apply security attributes to the file so that the only the System account of the previous installation can access the files. Even an administrator of this computer cannot reset these permissions. You must run TAKEOWN to delete these files.

After deleting the lock with TAKEOWN, you might have to use Windows Explorer or CACLS to give you full permissions to the files and directories before you can delete them.





Windows NT