Home
> Commands N-Z
> Commands T
TAKEOWN
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.
Syntax
TAKEOWN
[/A]
[/D {Y | N}]
/F [share_name\]file_name
[/R]
[/S computer
[/U [domain\]user
[/P [password]]]]
Parameters
none.
Switches
- /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:
- Y to take ownership
- N to suppress the confirmation prompt
- /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.
Related
none.
Notes
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.
Examples
none.
Errorlevels
none.
Availability
- External
-
- DOS
-
none
- Windows
-
none
- Windows NT
-
NT2003
Last Updated: 2003/07/28
Direct corrections or suggestions to:
Rick Lively