takeown | new in WS2003 |
Lets an administrator take ownership of a file.
takeown [/s Computer [/u [ Domain \ User [/p [ Password ]]]] /f FileName [/a] [/r] [/d {Y N}]
Name or IP address of a remote computer (if omitted, defaults to local computer)
Credentials for running the command (if omitted, defaults to currently logged-on user)
A file or directory name pattern (wildcard character * and ShareName\FileName format are supported)
Assigns ownership to Administrators group instead of current user
Recursive operation on all files in the specified directory and subdirectories
Default prompt to use when current user doesn't have permission to view folders in a directory ( Y takes ownership and N suppresses confirmation prompt)
Take ownership of the folder C:\docs and the files within it on the remote computer with IP address 172.16.11.230:
takeown /s 172.16.11.230 /f C:\docs /r /d N SUCCESS: The file (or folder): "\172.16.11.230\C$\docs" now owned by user "MTIT\Administrator". SUCCESS: The file (or folder): "\172.16.11.230\C$\docs\resume.txt" now owned by user "MTIT\Administrator".
cacls , Permissions