tldr/pages/windows/takeown.md

21 lines
530 B
Markdown
Raw Normal View History

2019-08-23 17:56:41 +01:00
# takeown
> Take ownership of a file or directory.
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/takeown>.
2019-08-23 17:56:41 +01:00
- Take ownership of the specified file:
`takeown /f {{path\to\file}}`
2019-08-23 17:56:41 +01:00
- Take ownership of the specified directory:
`takeown /d {{path\to\directory}}`
2019-08-23 17:56:41 +01:00
- Take ownership of the specified directory and all subdirectories:
`takeown /r /d {{path\to\directory}}`
2019-08-23 17:56:41 +01:00
- Change ownership to the Administrator group instead of the current user:
`takeown /a /f {{path\to\file}}`