当前位置 主页 > 服务器问题 > win服务器问题汇总 >

    win2003 服务器磁盘权限安全设置批处理

    栏目:win服务器问题汇总 时间:2019-10-13 11:59

    复制代码 代码如下:
    @ECHO OFF
    title C盘权限批量处理-2010.7.1
    echo -----------------------------
    echo IIS7站长之家服务器C盘权限设置
    echo //www.jb51.net
    echo -----------------------------
    :menu
    echo.
    echo [1] 删除C盘的everyone的权限
    echo [2] 删除C盘的所有的users的访问权限
    echo [3] 添加iis_wpg的访问权限
    echo [4] 添加iis_wpg的访问权限[.net专用]
    echo [5] 添加iis_wpg的访问权限[装了MACFEE的软件专用]
    echo [6] 添加users的访问权限
    echo [7] 删除C盘Windows下的所有的危险文件夹
    echo [8] 删除系统危险文件的访问权限,只留管理组成员
    echo [9] 注册表相关设定
    echo [10] 将C盘权限还原为默认[需重启]
    echo [0] 退出
    echo.
    @echo 请选择?
    @echo 输入上面的选项回车
    @echo off
    set /p menu=

    if %menu% == 0 goto exit
    if %menu% == 1 goto 1
    if %menu% == 2 goto 2
    if %menu% == 3 goto 3
    if %menu% == 4 goto 4
    if %menu% == 5 goto 5
    if %menu% == 6 goto 6
    if %menu% == 7 goto 7
    if %menu% == 8 goto 8
    if %menu% == 9 goto 9
    if %menu% == 10 goto 10

    :1
    echo 删除C盘的everyone的权限
    cacls "%SystemDrive%" /r "CREATOR OWNER" /e
    cacls "%SystemDrive%" /r "everyone" /e
    cacls "%SystemRoot%" /r "everyone" /e
    cacls "%SystemDrive%/Documents and Settings" /r "everyone" /e
    cacls "%SystemDrive%/Documents and Settings/All Users" /r "everyone" /e
    cacls "%SystemDrive%/Documents and Settings/All Users/Documents" /r "everyone" /e
    echo.
    echo 删除C盘的everyone的权限 ………………ok!
    echo.
    goto menu

    :2
    echo 删除C盘的所有的users的访问权限
    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