Win2003 Server disk Permissions security Settings batch processing _win server

Source: Internet
Author: User
Tags goto posix nslookup
Copy Code code as follows:

@ECHO off
Title C disk Permission batch processing-2010.7.1
Echo-----------------------------
Echo Cloud Community Server C disk permission settings
Echo http://www.jb51.net
Echo-----------------------------
: Menu
Echo.
echo [1] Removes everyone's permission from the C disk
echo [2] removes access rights for all users in C disk
echo [3] Add IIS_WPG access rights
echo [4] Add IIS_WPG access rights [. NET private]
echo [5] Add IIS_WPG access rights [installed MacFee software Exclusive]
echo [6] Add access rights for users
echo [7] Remove all dangerous folders in C-disk under Windows
echo [8] Remove access to system dangerous files, leaving only administrative group members
echo [9] Registry Related settings
echo [10] Restores C disk permissions to default [reboot required]
echo [0] Exits
Echo.
@echo Please choose?
@echo Enter the options above for carriage return
@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% = = Goto 10

: 1
Echo Remove Everyone's permissions on the C disk
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 Remove Everyone's permissions on C-Disk ..... ok!----
Echo.
Goto Menu

: 2
Echo removes access rights for all users in C disk
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.
echo removes all access rights for all users in C-disk .... ok!----
Echo.
Goto Menu


: 7
echo Remove all Dangerous folders in C disk under Windows
attrib%systemroot%/web/printers-s-r-h
del%systemroot%\web\printers\*.*/s/q/F
RD%SYSTEMROOT%\WEB\PRINTERS/S/Q

attrib%systemroot%\help\iishelp-s-r-h
del%systemroot%\help\iishelp\*.*/s/q/F
RD%SYSTEMROOT%\HELP\IISHELP/S/Q

attrib%systemroot%\system32\inetsrv\iisadmpwd-s-r-h
del%systemroot%\system32\inetsrv\iisadmpwd\*.*/s/q/F
RD%SYSTEMROOT%\SYSTEM32\INETSRV\IISADMPWD/S/Q
Echo.
echo Remove all Dangerous folders in C-disk windows ... ok!-------
Echo.
Goto Menu


: 8
echo Sets permissions settings for system dangerous files
cacls "C:\boot.ini"/t/c/e/g administrators:f
cacls "C:\boot.ini"/d guests:f/e

cacls "C:\AUTOEXEC. BAT "/t/c/e/g administrators:f
cacls "C:\AUTOEXEC. BAT "/d guests:f/e

cacls "%systemroot%/system32/net.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/net.exe"/d guests:f/e

cacls "%systemroot%/system32/net1.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/net1.exe"/d guests:f/e

cacls "%systemroot%/system32/cmd.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/cmd.exe"/d guests:f/e

cacls "%systemroot%/system32/ftp.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/ftp.exe"/d guests:f/e

cacls "%systemroot%/system32/netstat.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/netstat.exe"/d guests:f/e

cacls "%systemroot%/system32/regedit.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/regedit.exe"/d guests:f/e

cacls "%systemroot%/system32/at.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/at.exe"/d guests:f/e

cacls "%systemroot%/system32/attrib.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/attrib.exe"/d guests:f/e

cacls "%systemroot%/system32/format.com"/t/c/e/g administrators:f
cacls "%systemroot%/system32/format.com"/d guests:f/e

cacls "%systemroot%/system32/logoff.exe"/t/c/e/g administrators:f

cacls "%systemroot%/system32/shutdown.exe"/g administrators:f
cacls "%systemroot%/system32/shutdown.exe"/d guests:f/e

cacls "%systemroot%/system32/telnet.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/telnet.exe"/d guests:f/e

cacls "%systemroot%/system32/wscript.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/wscript.exe"/d guests:f/e

cacls "%systemroot%/system32/doskey.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/doskey.exe"/d guests:f/e

cacls "%systemroot%/system32/help.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/help.exe"/d guests:f/e

cacls "%systemroot%/system32/ipconfig.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/ipconfig.exe"/d guests:f/e

cacls "%systemroot%/system32/nbtstat.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/nbtstat.exe"/d guests:f/e

cacls "%systemroot%/system32/print.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/print.exe"/d guests:f/e

cacls "%systemroot%/system32/xcopy.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/xcopy.exe"/d guests:f/e

cacls "%systemroot%/system32/edit.com"/t/c/e/g administrators:f
cacls "%systemroot%/system32/edit.com"/d guests:f/e

cacls "%systemroot%/system32/regedt32.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/regedt32.exe"/d guests:f/e

cacls "%systemroot%/system32/reg.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/reg.exe"/d guests:f/e

cacls "%systemroot%/system32/register.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/register.exe"/d guests:f/e

cacls "%systemroot%/system32/replace.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/replace.exe"/d guests:f/e

cacls "%systemroot%/system32/nwscript.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/nwscript.exe"/d guests:f/e

cacls "%systemroot%/system32/share.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/share.exe"/d guests:f/e

cacls "%systemroot%/system32/ping.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/ping.exe"/d guests:f/e

cacls "%systemroot%/system32/ipsec6.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/ipsec6.exe"/d guests:f/e

cacls "%systemroot%/system32/netsh.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/netsh.exe"/d guests:f/e

cacls "%systemroot%/system32/debug.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/debug.exe"/d guests:f/e

cacls "%systemroot%/system32/route.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/route.exe"/d guests:f/e

cacls "%systemroot%/system32/tracert.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/tracert.exe"/d guests:f/e

cacls "%systemroot%/system32/powercfg.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/powercfg.exe"/d guests:f/e

cacls "%systemroot%/system32/nslookup.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/nslookup.exe"/d guests:f/e

cacls "%systemroot%/system32/arp.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/arp.exe"/d guests:f/e

cacls "%systemroot%/system32/rsh.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/rsh.exe"/d guests:f/e

cacls "%systemroot%/system32/netdde.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/netdde.exe"/d guests:f/e

cacls "%systemroot%/system32/mshta.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/mshta.exe"/d guests:f/e

cacls "%systemroot%/system32/mountvol.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/mountvol.exe"/d guests:f/e

cacls "%systemroot%/system32/tftp.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/tftp.exe"/d guests:f/e

cacls "%systemroot%/system32/setx.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/setx.exe"/d guests:f/e

cacls "%systemroot%/system32/find.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/find.exe"/d guests:f/e

cacls "%systemroot%/system32/finger.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/finger.exe"/d guests:f/e

cacls "%systemroot%/system32/where.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/where.exe"/d guests:f/e

cacls "%systemroot%/system32/regsvr32.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/regsvr32.exe"/d guests:f/e

cacls "%systemroot%/system32/cacls.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/cacls.exe"/d guests:f/e

cacls "%systemroot%/system32/sc.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/sc.exe"/d guests:f/e

cacls "%systemroot%/system32/shadow.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/shadow.exe"/d guests:f/e

cacls "%systemroot%/system32/runas.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/runas.exe"/d guests:f/e

cacls "%systemroot%/system32/wshom.ocx"/t/c/e/g administrators:f
cacls "%systemroot%/system32/wshom.ocx"/d guests:f/e

cacls "%systemroot%/system32/wshext.dll"/t/c/e/g administrators:f
cacls "%systemroot%/system32/wshext.dll"/d guests:f/e

cacls "%systemroot%/system32/shell32.dll"/t/c/e/g administrators:f
cacls "%systemroot%/system32/shell32.dll"/d guests:f/e

cacls "%systemroot%/system32/zipfldr.dll"/t/c/e/g administrators:f
cacls "%systemroot%/system32/zipfldr.dll"/d guests:f/e

cacls "%systemroot%/pchealth/helpctr/binaries/msconfig.exe"/t/c/e/g administrators:f
cacls "%systemroot%/pchealth/helpctr/binaries/msconfig.exe"/d guests:f/e

cacls "%systemroot%/notepad.exe"/t/c/e/g administrators:f
cacls "%systemroot%/notepad.exe"/d guests:f/e

cacls "%systemroot%/regedit.exe"/t/c/e/g administrators:f
cacls "%systemroot%/regedit.exe"/d guests:f/e

cacls "%systemroot%/winhelp.exe"/t/c/e/g administrators:f
cacls "%systemroot%/winhelp.exe"/d guests:f/e

cacls "%systemroot%/winhlp32.exe"/t/c/e/g administrators:f
cacls "%systemroot%/winhlp32.exe"/d guests:f/e

cacls "%systemroot%/system32/notepad.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/notepad.exe"/d guests:f/e

cacls "%systemroot%/system32/edlin.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/edlin.exe"/d guests:f/e

cacls "%systemroot%/system32/posix.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/posix.exe"/d guests:f/e

cacls "%systemroot%/system32/atsvc.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/atsvc.exe"/d guests:f/e

cacls "%systemroot%/system32/qbasic.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/qbasic.exe"/t/c/e/g administrators:f

cacls "%systemroot%/system32/runonce.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/runonce.exe"/d guests:f/e

cacls "%systemroot%/system32/syskey.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/syskey.exe"/d guests:f/e

cacls "%systemroot%/system32/cscript.exe"/t/c/e/g administrators:f
cacls "%systemroot%/system32/cscript.exe"/d guests:f/e
Echo.
echo Sets permissions setting for system dangerous files ... ok!, ........
Echo.
Goto Menu

: 9
Echo Registry Related Settings
Reg delete hkey_classes_root\wscript.shell/f
Reg delete hkey_classes_root\wscript.shell.1/f
Reg delete Hkey_classes_root\shell.application/f
Reg delete hkey_classes_root\shell.application.1/f
Reg delete hkey_classes_root\wscript.network/f
Reg delete hkey_classes_root\wscript.network.1/f
REGSVR32/S/U wshom.ocx
REGSVR32/S/U Wshext.dll
REGSVR32/S/u Shell32.dll
REGSVR32/S/U Zipfldr.dll
Echo.
echo Registry Related Settings ..... ok!. .......
Echo.
Goto Menu


: 3
echo Add IIS_WPG access rights
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.
Echo adds IIS_WPG access rights ... ok!. .........
Echo.
Goto Menu


: 4
echo Add IIS_WPG access rights [. NET private]
cacls "%systemroot%/assembly"/g iis_wpg:c/e
cacls "%systemroot%/microsoft.net"/g iis_wpg:c/e
Echo.
Echo adds IIS_WPG's access rights [. NET private] ... ok!. .......
Echo.
Goto Menu

: 5
echo Add IIS_WPG access rights [installed MacFee software Exclusive]
cacls "%systemdrive%/program files/network Associates"/g iis_wpg:r/e
Echo.
echo Add IIS_WPG access rights [installed MacFee software Exclusive] ... ok!........
Echo.
Goto Menu

: 6
echo Add access rights for users
cacls "%systemroot%/temp"/g users:c/e
Echo.
echo Add access rights for users ..... ok!-----
Echo.
Goto Menu

: 10
echo restores C disk permissions to default
secedit/configure/db%systemroot%\security\database\cvtfs.sdb/cfg "%systemroot%\security\templates\setup Security.inf "/areas Filestore
Goto Menu

: Exit

Exit

Set up server disk security by saving the above code as Xx.bat
In fact, the batch processing of Qingyun is also good, we can choose to download the address according to Http://www.jb51.net/softs/12762.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.