21

I want to set a specific folder with specific rights to inherit all rights of it's parent folder. I know I should use icacls.

My folders look like this:

- mp
  - build (set this one to inherit from mp)
Asken
  • 7,679
  • 10
  • 45
  • 77

1 Answers1

41

Like this:

icacls "build\*" /q /c /t /reset

The secret was:

/reset - Replaces ACLs with default inherited ACLs for all matching files.
/t     - Performs the operation on all specified files in the current directory and its subdirectories.

Read more at Microsoft Technet icacls

Asken
  • 7,679
  • 10
  • 45
  • 77
  • 1
    I was having no luck and getting "invalid parameter" using /grant switch with (I) flag, but /reset worked like a charm! – satoc Dec 11 '15 at 02:50
  • Thanks, I managed to miss the reset option in the help. As /T is being used for recursion, I don't think \\* is needed in the path. – WhoIsRich Jan 20 '16 at 15:35
  • 1
    `\*` is definitely needed if you want to reset just child folders and files, not the build folder itself. Otherwise the build folder reverts to its parent's inheritance settings – tb1 Feb 17 '21 at 15:12