如何在批处理文件中使用 icacls 来更改文件夹结构中的 ACL
How to use icacls in batch file to change ACL's in folder structure
我想编写一个批处理文件来更改 Windows 服务器上某些文件夹结构中的 ACL。
供应商编号(100000 到 102000)
- 下载 -> 只读
- 分享 -> 读+写但不删除
供应商编号从 100000 到 102000,因此这需要一个循环。
请问如何使用 icacls(或 cacls)创建此批次?
@Binarus 你说得对,其实没那么难。
这是我想出的:
FOR /L %%i IN (100000,1,1002000) DO (
icacls %%i\Download /grant:r <username>:R
icacls %%i\Share /grant:r <username>:R /grant <username>:W /deny <username>:D
)
我想编写一个批处理文件来更改 Windows 服务器上某些文件夹结构中的 ACL。
供应商编号(100000 到 102000)
- 下载 -> 只读
- 分享 -> 读+写但不删除
供应商编号从 100000 到 102000,因此这需要一个循环。 请问如何使用 icacls(或 cacls)创建此批次?
@Binarus 你说得对,其实没那么难。
这是我想出的:
FOR /L %%i IN (100000,1,1002000) DO (
icacls %%i\Download /grant:r <username>:R
icacls %%i\Share /grant:r <username>:R /grant <username>:W /deny <username>:D
)