windowsbatch-filepermissionsfolder-permissionsicacls

icacls function not overwriting the previous directory permissions


I am using the following code:

icacls C:\testscott\ /grant:r "TestGroup":(NP)F

However, the existing permissions in the directory C:\testscott\ are still there. I thought using the /grant:r option meant it would overwrite the existing permissions?


Solution

  • To replace all permissions on a directory with newly assigned ones:

    icacls c:\test /reset
    icacls c:\test /inheritance:r /grant Administrators:(OI)(CI)(F)