天下网吧 >> 网吧系统 >> 桌面系统 >> 正文

cacls命令使用详解-命令行设置文件权限

2014-3-25天下网吧论坛收集佚名
echo "删除C盘的EVEryone的权限"
cd/
cacls "%SystemDrive%" /r "EVEryone" /e
cacls "%SystemRoot%" /r "EVEryone" /e
cacls "%SystemRoot%/Registration" /r "EVEryone" /e
cacls "%SystemDrive%/Documents and Settings" /r "EVEryone" /e

echo "删除C盘的所有的users的访问权限"
cd/
cacls "%SystemDrive%" /r "users" /e
cacls "%SystemDrive%/Program Files" /r "users" /e
cacls "%SystemDrive%/Documents and Settings" /r "users" /e
cacls "%SystemRoot%" /r "users" /e
cacls "%SystemRoot%/addins" /r "users" /e
cacls "%SystemRoot%/AppPatch" /r "users" /e
cacls "%SystemRoot%/Connection Wizard" /r "users" /e
cacls "%SystemRoot%/Debug" /r "users" /e
cacls "%SystemRoot%/Driver Cache" /r "users" /e
cacls "%SystemRoot%/Help" /r "users" /e
cacls "%SystemRoot%/IIS Temporary Compressed Files" /r "users" /e
cacls "%SystemRoot%/java" /r "users" /e
cacls "%SystemRoot%/msagent" /r "users" /e
cacls "%SystemRoot%/mui" /r "users" /e
cacls "%SystemRoot%/repair" /r "users" /e
cacls "%SystemRoot%/Resources" /r "users" /e
cacls "%SystemRoot%/security" /r "users" /e
cacls "%SystemRoot%/system" /r "users" /e
cacls "%SystemRoot%/TAPI" /r "users" /e
cacls "%SystemRoot%/Temp" /r "users" /e
cacls "%SystemRoot%/twain_32" /r "users" /e
cacls "%SystemRoot%/Web" /r "users" /e
cacls "%SystemRoot%/WinSxS" /r "users" /e
cacls "%SystemRoot%/system32/3com_dmi" /r "users" /e
cacls "%SystemRoot%/system32/administration" /r "users" /e
cacls "%SystemRoot%/system32/Cache" /r "users" /e
cacls "%SystemRoot%/system32/CatRoot2" /r "users" /e
cacls "%SystemRoot%/system32/Com" /r "users" /e
cacls "%SystemRoot%/system32/config" /r "users" /e
cacls "%SystemRoot%/system32/dhcp" /r "users" /e
cacls "%SystemRoot%/system32/drivers" /r "users" /e
cacls "%SystemRoot%/system32/export" /r "users" /e
cacls "%SystemRoot%/system32/icsxml" /r "users" /e
cacls "%SystemRoot%/system32/lls" /r "users" /e
cacls "%SystemRoot%/system32/LogFiles" /r "users" /e
cacls "%SystemRoot%/system32/MicROSoftPassport" /r "users" /e
cacls "%SystemRoot%/system32/mui" /r "users" /e
cacls "%SystemRoot%/system32/oobe" /r "users" /e
cacls "%SystemRoot%/system32/ShellExt" /r "users" /e
cacls "%SystemRoot%/system32/wbem" /r "users" /e
echo "添加iis_wpg的访问权限"
cacls "%SystemRoot%" /g iis_wpg:r /e
cacls "%SystemDrive%/Program Files/Common Files" /g iis_wpg:r /e
cacls "%SystemRoot%/Downloaded Program Files" /g iis_wpg:c /e
cacls "%SystemRoot%/Help" /g iis_wpg:c /e
cacls "%SystemRoot%/IIS Temporary Compressed Files" /g iis_wpg:c /e
cacls "%SystemRoot%/Offline Web Pages" /g iis_wpg:c /e
cacls "%SystemRoot%/System32" /g iis_wpg:c /e
cacls "%SystemRoot%/Tasks" /g iis_wpg:c /e
cacls "%SystemRoot%/Temp" /g iis_wpg:c /e
cacls "%SystemRoot%/Web" /g iis_wpg:c /e
echo "添加iis_wpg的访问权限[.net专用]"
cacls "%SystemRoot%/Assembly" /g iis_wpg:c /e
cacls "%SystemRoot%/MicROSoft.NET" /g iis_wpg:c /e
echo "添加iis_wpg的访问权限[装了MACFEE的软件专用]"
cacls "%SystemDrive%/Program Files/Network Associates" /g iis_wpg:r /e
echo "添加users的访问权限"
cacls "%SystemRoot%/temp" /g users:c


修改目录和ACL设置用户访问权限:我们经常要修改目录和文件的访问权限,
使用Cacls命令就很容易做到。下面要赋予本机用户Chenfeng对E盘下CCE目录及其所有子目录中的文
件有完全控制权限。在命令提示符对话框中输入“Cacls CCE /t /e /c /g Chenfeng:f ”命令即可。



2.修改目录和ACL设置用户访问权限:我们经常要修改目录和文件的访问权限,
使用Cacls命令就很容易做到。下面要赋予本机用户Chenfeng对E盘下CCE目录及其所有子目录中的
文件有完全控制权限。在命令提示符对话框中输入“Cacls CCE /t /e /c /g Chenfeng:f ”命令即可。
  
3撤销用户访问权限:要想撤销本机用户Chenfeng对该目录的完全控制权限也很容易,
在命令提示符中运行“Cacls CCE /t /e /c /r Chenfeng ”即可。
  
  shellapi


4拒绝用户访问:要想拒绝用户Chenfeng访问CCE目录及其所有子目录中的文件,
运行“Cacls CCE /t /e /c /d Chenfeng”即可。

本文来源:天下网吧论坛收集 作者:佚名

声明
声明:本站所发表的文章、评论及图片仅代表作者本人观点,与本站立场无关。若文章侵犯了您的相关权益,请及时与我们联系,我们会及时处理,感谢您对本站的支持!联系Email:support@txwb.com,系统开号,技术支持,服务联系QQ:1175525021本站所有有注明来源为天下网吧或天下网吧论坛的原创作品,各位转载时请注明来源链接!
天下网吧·网吧天下