You can grant permissions to a user on a directory (Read, Write, Modify) using the Windows command line, for example,
icacls “D:\dy” /grant administrtor:(OI)(CI)F /T
F
= Full ControlCI
= 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
andCI
only apply to new files and sub-folders). Credit: comment by @AlexSpence.
To take ownership:
icacls “D:\dy” /grant Administrators:F /T /C