takeown

Take ownership of a path. /f is the file or directory. /r recurses.

takeown /f <path> /r

Current directory, assign to Administrators, recurse, and answer Yes to prompts:

takeown /F "." /A /R /D Y

Caution: takeown changes ownership and typically needs elevation.

Updated: 2026 Aug 19