Windows/Take Ownership: Difference between revisions
< Windows
(Created page with " takeown /f "C:\Path\To\Folder" /r /d y icacls "C:\Path\To\Folder" /grant Administrators:F /t rmdir /s /q "C:\Path\To\Folder"") |
No edit summary |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
Run from a user in Administrators group, and from a command line window elevated to Administrator permission | |||
takeown /f "C:\Path\To\Folder" /r /d y | takeown /f "C:\Path\To\Folder" /r /d y | ||
# or give ownership to Administrators group | |||
takeown /A /f "C:\Path\To\Folder" /r /d y | |||
icacls "C:\Path\To\Folder" /grant Administrators:F /t | icacls "C:\Path\To\Folder" /grant Administrators:F /t | ||
# or | |||
icacls "C:\Path\To\Folder" /grant USERNAME:F /t | |||
If you wanted to then delete the folder: | |||
rmdir /s /q "C:\Path\To\Folder" | rmdir /s /q "C:\Path\To\Folder" | ||
Latest revision as of 19:45, 19 December 2025
Run from a user in Administrators group, and from a command line window elevated to Administrator permission
takeown /f "C:\Path\To\Folder" /r /d y # or give ownership to Administrators group takeown /A /f "C:\Path\To\Folder" /r /d y
icacls "C:\Path\To\Folder" /grant Administrators:F /t # or icacls "C:\Path\To\Folder" /grant USERNAME:F /t
If you wanted to then delete the folder:
rmdir /s /q "C:\Path\To\Folder"