使用icacls设置文件夹的权限以递归继承

Ask*_*ken 18 windows icacls

我想设置一个具有特定权限的特定文件夹,以继承其父文件夹的所有权限.我知道我应该用icacls.

我的文件夹看起来像这样:

- mp
  - build (set this one to inherit from mp)
Run Code Online (Sandbox Code Playgroud)

Ask*_*ken 34

像这样:

icacls "build\*" /q /c /t /reset
Run Code Online (Sandbox Code Playgroud)

秘密是:

/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.
Run Code Online (Sandbox Code Playgroud)

阅读Microsoft Technet icacls的更多信息