Windows/Take Ownership: Difference between revisions

From Omnia
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 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
  # 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"