CACLS命令如何转换为ICACLS?
CACLS "C:\Windows\System32\inetsrv\config" /G "Network Service":R /E
我的疑问主要是用参数/ E。
使用/grant或/deny开关的icacls的默认行为是编辑ACL。 您不需要像使用cacls明确指定编辑操作。
使用icacls来镜像你的例子:
icacls "C:\Windows\System32\inetsrv\config" /grant "Network Service":(R)
您也可以使用/grant和/deny结合使用:r删除现有的显式授予的权限。 请看icacls /? 为完整的细节 。
编辑:
如果您打算从PS调用icacls ,引用工作方式不同。 请尝试:
icacls 'C:\Windows\System32\inetsrv\config' /grant 'Network Service:(R)'