How to grant full permission to a user for a directory

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 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.

To take ownership:

icacls “D:\dy” /grant Administrators:F /T /C

Published by

Bob Lin

Bob Lin, Chicagotech-MVP, MCSE & CNE Data recovery, Windows OS Recovery, Networking, and Computer Troubleshooting on http://www.ChicagoTech.net How to Install and Configure Windows, VMware, Virtualization and Cisco on http://www.HowToNetworking.com