Take Ownership of a File Tree
Recover access to files whose permissions no longer match the current accounts.
01Command
$ takeown /f C:\data /r /d y02What 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
04Undo
$ icacls C:\data /reset /t05Sources
- takeownEvidence: Enables an administrator to recover access to a file by making them the owner.
Last verified: 2026-10-13 · Category: System & Settings
06Related solutions
Diagnose NTFS file system errors and bad sectors on any volume — including the system drive while Windows is running — before committing to a repair.
Robocopy is Windows' built-in robust file copier: use /MIR to keep a destination folder as an exact one-way mirror of a source, resumable and restartable.
Two-step command sequence that makes you the owner of a locked file tree and grants yourself full control — the standard fix for 'Access is denied' on old profiles and OS reinstall leftovers.