Take ownership of a folder or drive and all contents

Icacls d:\users /setowner “everyone” /t /c

then you need grant permission for user access, run comand:

icacls d:\users /grant everyone:(OI)(CI)F /T

  • F = Full Control
  • CI = Container Inherit – This flag indicates that subordinate containers will inherit this ACE.
  • OI = Object Inherit – This flag indicates that subordinate files will inherit the ACE.
  • /T = Apply recursively to existing files and sub-folders. (OI and CI only apply to new files and sub-folders). Credit: comment by @AlexSpence.

You may also like...