Windows/Take Ownership: Difference between revisions
< Windows
No edit summary |
No edit summary |
||
| Line 7: | Line 7: | ||
# or | # or | ||
icacls "C:\Path\To\Folder" /grant USERNAME:F /t | icacls "C:\Path\To\Folder" /grant USERNAME:F /t | ||
If you wanted to then delete the 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"