我刚刚学习了如何使用 icacls 设置文件夹的权限。更好的是,我想确保文件夹是只读的。有人有什么想法吗?
C:>icacls.exe C:\TEMP\Reports [开关]
答案1
也许是这样?试着搜索一下网站,有很多icacls 示例。
REM take ownership and reset permissions
TAKEOWN /f "C:\TEMP\Reports" /r /d y
ICACLS "C:\TEMP\Reports" /reset /T
REM grant full control to administrators, read only to everyone else
ICACLS "C:\TEMP\Reports" /grant:r "BUILTIN\ADMINISTRATORS":(OI)(CI)F ^
/grant:r "BUILTIN\EVERYONE":(OI)(CI)R ^
REM set inheritance on everything below
ICACLS "C:\TEMP\Reports" /inheritance:r