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. (
CIonly apply to new files and sub-folders). Credit: comment by @AlexSpence.