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.
0 0 votes
Article Rating

You may also like...

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x