Take ownership command

takeown [/s Computer [/u [Domain\User [/p [Password]]]] /f FileName [/a] [/r] [/d {Y N}]

Parameters
/sComputer
Specifies the name or IP address of a remote computer (do not use backslashes). The default is the local computer. This parameter applies to all of files and folders specified in the command.

/uDomain\User
Runs the script with the permissions of the specified user account. The default is system permissions.

/p [Password]
Specifies the password of the user account that is specified in the /u parameter.

/fFileName
Specifies the file name or directory name pattern. You can use the wildcard character "*" in specifying the pattern. You can also use ShareName\FileName.

/a
Gives ownership to the administrators group instead of the current user.

/r
Performs recursive operation on all files in the specified directory and subdirectories.

/d {Y N}
Default prompt used when the current user does not have permissions to view folders within a directory. Use Y to take ownership and N to suppress the confirmation prompt.

No comments:

Recent Posts