How would I use Takeown to take ownership of all folders on one drive?

Is there a way in which I can use takeown to apply ownership to every directory on the drive?

This can be done in two different ways, using takeown or icacls.


Take Ownership of an Object using takeown Command

This command will take ownership of the folder or drive, and all files and subfolders in the folder or drive.

Open an elevated command prompt (administrator).

To grant ownership to administrators group:

takeown /F "full path of folder or drive" /A /R /D Y

To Take Ownership of a Folder or Drive and All Contents using icacls Command

Open an elevated command prompt (administrator).

To set administrators group as owner:

icacls "full path of folder or drive" /setowner "Administrators" /T /C

Further Reading

  • An A-Z Index of the Windows CMD command line - An excellent reference for all things Windows cmd line related.
  • icacls - Change file and folder permissions - display or modify Access Control Lists (ACLs) for files and folders.
  • takeown - Take ownership of a file (Windows 2003/7/2008).