Take Ownership of a File Tree

Recover access to files whose permissions no longer match the current accounts.

WindowsFilessystemadminpowershellLow risk
Run takeown /f C:\data /r /d y to take ownership recursively and answer Yes to prompts.

01Command

Command
$ takeown /f C:\data /r /d y

02What it does

After restoring a backup or moving data, ACLs may reference accounts that no longer exist, locking everyone out; takeown reassigns ownership so permissions can then be fixed. Applying it recursively across many folders is far faster and more consistent by script than through Explorer dialogs.

03Risk

RiskLow risk
RequirementsRun from an elevated Command Prompt
!Warning: Changing ownership changes who can control permissions; record the original ACLs and grant access deliberately afterwards.

04Undo

Undo
$ icacls C:\data /reset /t

05Sources

  • takeown
    Microsoft Learn · vendor-doc · 2026-09-20
    Evidence: Enables an administrator to recover access to a file by making them the owner.

Last verified: 2026-10-13 · Category: System & Settings

06Related solutions