批处理设置windows服务器的代码ThecSafe1.9.4第1/3页
批处理设置windows服务器的代码ThecSafe1.9.4第1/3页
发布时间:2016-12-28 来源:查字典编辑
摘要:@EchoOffTITLE常来网服务器高级安全设置器:startCLSCOLOR1fRem使用COLOR命令对控制台输出颜色进行更改MODE...

@EchoOff

TITLE常来网服务器高级安全设置器

:start

CLS

COLOR1f

Rem使用COLOR命令对控制台输出颜色进行更改

MODEcon:COLS=32LINES=21

RemMODE语句为设定窗体的宽和高

Settm1=%time:~0,2%

Settm2=%time:~3,2%

Settm3=%time:~6,2%

Echo%date%%tm1%点%tm2%分%tm3%秒

Echo================================

Echo请选择要进行的操作,然后按回车

Echo───────────────

Echo.

EchoA.一键搞定/全自动设置服务器

Echo0.清理系统垃圾文件

Echo1.给系统危险文件设置权限

Echo2.给系统危险文件夹设置权限

Echo3.系统服务优化

Echo4.注册表危险组件删除

Echo5.防DDOS洪水攻击处理

Echo6.导入常来网专用安全策略

Echo7.重启IIS使设置生效

Echo8.刷新当前时间

Echo9.锁定计算机

EchoL.注销当前用户

EchoQ.退出安全设置器

Echo.

:cho

SetChoice=

Set/PChoice=选择:

Rem设定变量"Choice"为用户输入的字符

IfNot"%Choice%"==""SetChoice=%Choice:~0,1%

Rem如果输入大于1位,取第1位,比如输入132,则返回值为1

Echo.

If/I"%Choice%"=="A"GotoAuto

If/I"%Choice%"=="0"GotoClear

If/I"%Choice%"=="1"GotoSetFile

If/I"%Choice%"=="2"GotoSetFolder

If/I"%Choice%"=="3"GotoService

If/I"%Choice%"=="4"GotoReg

If/I"%Choice%"=="5"GotoDdos

If/I"%Choice%"=="6"GotoIpsec

If/I"%Choice%"=="7"Gotorestartiis

If/I"%Choice%"=="8"Gotostart

If/I"%Choice%"=="9"Gotolock

If/I"%Choice%"=="L"Gotologoff

If/I"%Choice%"=="Q"GotoEnd

Rem为避免出现返回值为空或含空格而导致程序异常,需在变量外另加双引号

Rem注意,If语句需要双等于号

Rem如果输入的字符不是以上数字,将返回重新输入

Echo选择无效,请重新输入

Echo.

Gotocho

:Clear

CLS

MODEcon:COLS=80LINES=18

COLOR70

Echo.

Echo正在清理系统垃圾文件,请稍等......

del/f/s/q%systemdrive%*.tmp

del/f/s/q%systemdrive%*._mp

del/f/s/q%systemdrive%*.gid

del/f/s/q%systemdrive%*.chk

del/f/s/q%systemdrive%*.old

del/f/s/q%systemdrive%recycled*.*

del/f/s/q%windir%*.bak

del/f/s/q%windir%prefetch*.*

del/f/s/q%windir%temp*.*

del/f/s/q%userprofile%cookies*.*

del/f/s/q%userprofile%recent*.*

del/f/s/q"%userprofile%LocalSettingsTemporaryInternetFiles*.*"

del/f/s/q"%userprofile%LocalSettingsTemp*.*"

del/f/s/q"%userprofile%recent*.*"

Echo清理系统垃圾完成!请按任意键返回并选1继续...

PAUSE>nul

Gotostart

:SetFile

CLS

MODEcon:COLS=80LINES=18

COLOR70

Echo.

Rem删除系统危险文件的访问权限,只留管理组成员

cscript.exexcacls.vbs"%SystemDrive%/boot.ini"/GAdministrators:F

cscript.exexcacls.vbs"%SystemDrive%/boot.ini"/DGuests:F/E

cscript.exexcacls.vbs"%SystemDrive%/AUTOEXEC.BAT"/GAdministrators:F

cscript.exexcacls.vbs"%SystemDrive%/AUTOEXEC.BAT"/DGuests:F/E

cscript.exexcacls.vbs"%SystemDrive%/ProgramFiles/InternetExplorer/iexplore.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemDrive%/ProgramFiles/InternetExplorer/iexplore.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/net.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/net.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/net1.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/net1.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/cmd.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/cmd.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/ftp.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/ftp.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/scrrun.dll"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/scrrun.dll"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/shell.dll"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/shell.dll"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/netstat.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/netstat.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/regedit.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/regedit.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/secedit.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/secedit.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/gpresult.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/gpresult.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/gpupdate.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/gpupdate.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/at.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/at.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/attrib.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/attrib.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/format.com"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/format.com"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/logoff.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/logoff.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/shutdown.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/shutdown.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/telnet.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/telnet.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/wscript.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/wscript.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/doskey.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/doskey.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/help.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/help.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/ipconfig.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/ipconfig.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/nbtstat.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/nbtstat.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/print.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/print.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/xcopy.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/xcopy.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/edit.com"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/edit.com"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/regedt32.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/regedt32.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/reg.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/reg.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/register.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/register.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/replace.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/replace.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/nwscript.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/nwscript.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/share.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/share.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/ping.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/ping.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/ipsec6.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/ipsec6.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/netsh.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/netsh.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/debug.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/debug.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/route.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/route.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/tracert.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/tracert.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/powercfg.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/powercfg.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/nslookup.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/nslookup.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/arp.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/arp.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/rsh.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/rsh.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/netdde.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/netdde.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/mshta.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/mshta.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/mountvol.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/mountvol.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/tftp.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/tftp.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/setx.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/setx.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/find.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/find.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/finger.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/finger.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/where.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/where.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/regsvr32.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/regsvr32.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/cacls.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/cacls.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/sc.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/sc.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/shadow.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/shadow.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/runas.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/runas.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/wshom.ocx"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/wshom.ocx"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/wshext.dll"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/wshext.dll"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/shell32.dll"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/shell32.dll"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/zipfldr.dll"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/zipfldr.dll"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/PCHealth/HelpCtr/Binaries/msconfig.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/PCHealth/HelpCtr/Binaries/msconfig.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/notepad.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/notepad.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/regedit.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/regedit.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/winhelp.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/winhelp.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/winhlp32.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/winhlp32.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/notepad.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/notepad.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/edlin.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/edlin.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/posix.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/posix.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/atsvc.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/atsvc.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/qbasic.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/qbasic.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/runonce.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/runonce.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/syskey.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/syskey.exe"/DGuests:F/E

cscript.exexcacls.vbs"%SystemRoot%/system32/cscript.exe"/GAdministrators:F

cscript.exexcacls.vbs"%SystemRoot%/system32/cscript.exe"/DGuests:F/E

Echo给系统危险文件设置权限设定完毕!请按任意键返回并选2继续...

PAUSE>nul

Gotostart

:SetFolder

CLS

MODEcon:COLS=80LINES=18

COLOR70

Echo.

Rem删除C盘所有的Everone权限

cd/

cscript.exexcacls.vbs"%SystemDrive%"/r"Everyone"/e

cscript.exexcacls.vbs"%SystemRoot%"/r"Everyone"/e

@REM"cscript.exexcacls.vbs"%SystemRoot%/Registration"/r"Everyone"/e"这个不能去Everyone权限

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings"/r"Everyone"/e

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers"/r"Everyone"/e

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers/Documents"/r"Everyone"/e

cscript.exexcacls.vbs"%SystemDrive%/Inetpub/aspnet_client"/r"Everyone"/e

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers/ApplicationData/Microsoft"/r"Everyone"/e

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers/ApplicationData/Microsoft/HTMLHelp"/r"Everyone"/e

Rem删除C盘所有的CREATOROWNER权限

cd/

cscript.exexcacls.vbs"%SystemRoot%"/r"CREATOROWNER"/e

cscript.exexcacls.vbs"%SystemDrive%"/r"CREATOROWNER"/e

cscript.exexcacls.vbs"%SystemRoot%/repair"/r"CREATOROWNER"/e

cscript.exexcacls.vbs"%SystemRoot%/system32"/r"CREATOROWNER"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/wbem"/r"CREATOROWNER"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/config"/r"CREATOROWNER"/e

cscript.exexcacls.vbs"%SystemDrive%/ProgramFiles"/r"CREATOROWNER"/e

cscript.exexcacls.vbs"%SystemDrive%/ProgramFiles/WindowsUpdate"/r"CREATOROWNER"/e

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers/Documents"/r"CREATOROWNER"/e

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers/ApplicationData"/r"CREATOROWNER"/e

Rem删除C盘所有的PowerUsers权限

cd/

cscript.exexcacls.vbs"%SystemRoot%"/r"PowerUsers"/e

cscript.exexcacls.vbs"%SystemRoot%/repair"/r"PowerUsers"/e

cscript.exexcacls.vbs"%SystemRoot%/system32"/r"PowerUsers"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/wbem"/r"PowerUsers"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/config"/r"PowerUsers"/e

cscript.exexcacls.vbs"%SystemDrive%/ProgramFiles"/r"PowerUsers"/e

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings"/r"PowerUsers"/e

cscript.exexcacls.vbs"%SystemDrive%/ProgramFiles/WindowsUpdate"/r"PowerUsers"/e

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers"/r"PowerUsers"/e

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers/Documents"/r"PowerUsers"/e

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers/ApplicationData"/r"PowerUsers"/e

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers/ApplicationData/Microsoft"/r"PowerUsers"/e

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers/ApplicationData/Microsoft/HTMLHelp"/r"PowerUsers"/e

Rem删除C盘所有的TERMINALSERVERUSER权限

cd/

cscript.exexcacls.vbs"%SystemDrive%/ProgramFiles"/r"TERMINALSERVERUSER"/e

Rem添加Guests组拒绝权限[IUSR_XXX或某个虚拟主机用户组禁止列目录,可有效防止FSO类木马]

cd/

cscript.exexcacls.vbs"%SystemDrive%/ProgramFiles"/DGuests:1;1/E

cscript.exexcacls.vbs"%SystemRoot%/repair"/DGuests:1;1/E

cscript.exexcacls.vbs"%SystemRoot%/system32"/DGuests:1;1/E

cscript.exexcacls.vbs"%SystemRoot%/system32/config"/DGuests:1;1/E

cscript.exexcacls.vbs"%SystemRoot%/system32/inetsrv"/DGuests:1;1/E

cscript.exexcacls.vbs"%SystemRoot%/system32/inetsrv/MetaBack"/DGuests:1;1/E

cscript.exexcacls.vbs"%SystemRoot%/system32/inetsrv/ASPCompiledTemplates"/DGuests:1;1/E

cscript.exexcacls.vbs"%SystemRoot%/IISTemporaryCompressedFiles"/DGuests:1;1/E

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers/ApplicationData"/DGuests:1;1/E

cscript.exexcacls.vbs"%SystemRoot%/Microsoft.NET/Framework/v1.1.4322/TemporaryASP.NETFiles"/DGuests:1;1/E

cscript.exexcacls.vbs"%SystemRoot%/Microsoft.NET/Framework/v2.0.50727/TemporaryASP.NETFiles"/DGuests:1;1/E

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers/ApplicationData/Microsoft"/DGuests:1;1/E

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers/ApplicationData/Microsoft/Crypto/DSS/achineKeys"/DGuests:1;1/E

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers/ApplicationData/Microsoft/Crypto/RSA/MachineKeys"/DGuests:1;1/E

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers/ApplicationData/Microsoft/HTMLHelp"/DGuests:1;1/E

Rem删除C盘的所有的users的访问权限

cd/

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers"/r"users"/e

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers/Documents"/r"users"/e

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings/AllUsers/ApplicationData"/r"users"/e

cscript.exexcacls.vbs"%SystemDrive%"/r"users"/e

cscript.exexcacls.vbs"%SystemDrive%/ProgramFiles"/r"users"/e

cscript.exexcacls.vbs"%SystemDrive%/DocumentsandSettings"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/addins"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/AppPatch"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/ConnectionWizard"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/Debug"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/DriverCache"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/Help"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/IISTemporaryCompressedFiles"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/java"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/msagent"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/mui"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/repair"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/Resources"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/security"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/system"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/TAPI"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/twain_32"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/Web"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/3com_dmi"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/administration"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/Cache"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/CatRoot2"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/Com"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/config"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/dhcp"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/drivers"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/export"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/icsxml"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/lls"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/LogFiles"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/MicrosoftPassport"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/mui"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/oobe"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/system32/ShellExt"/r"users"/e

@Remcscript.exexcacls.vbs"%SystemRoot%/system32/wbem"/r"users"/e这里影响.NET程序的正常运行,所以去掉!

Rem添加IIS_WPG的访问权限

cscript.exexcacls.vbs"%SystemDrive%"/gIIS_WPG:;b468/e

cscript.exexcacls.vbs"%SystemRoot%"/gIIS_WPG:b1468;b1468/e

cscript.exexcacls.vbs"%SystemDrive%/ProgramFiles"/gIIS_WPG:r/e

cscript.exexcacls.vbs"%SystemRoot%/DownloadedProgramFiles"/gIIS_WPG:c/e

cscript.exexcacls.vbs"%SystemRoot%/Help"/gIIS_WPG:c/e

cscript.exexcacls.vbs"%SystemRoot%/IISTemporaryCompressedFiles"/gIIS_WPG:c/e

cscript.exexcacls.vbs"%SystemRoot%/OfflineWebPages"/gIIS_WPG:c/e

cscript.exexcacls.vbs"%SystemRoot%/System32"/gIIS_WPG:c/e

cscript.exexcacls.vbs"%SystemRoot%/Tasks"/gIIS_WPG:c/e

cscript.exexcacls.vbs"%SystemRoot%/Web"/gIIS_WPG:c/e

Rem添加iis_wpg的访问权限[装了MACFEE的软件专用]

Remcscript.exexcacls.vbs"%SystemDrive%/ProgramFiles/NetworkAssociates"/gIIS_WPG:r/e

Rem添加users的访问权限

cscript.exexcacls.vbs"%SystemRoot%/temp"/gEveryone:m/e

cscript.exexcacls.vbs"%SystemDrive%/ProgramFiles/CommonFiles"/gUsers:r/e

cscript.exexcacls.vbs"%SystemRoot%/Microsoft.NET/Framework"/gusers:b1468;b1468/e

Rem禁止[列出文件夹/读取数据]此权限出现

Rem-------------------------------------------

Rem添加Users的访问权限[装了PHP的服务器专用]

cscript.exexcacls.vbs"C:php5"/gusers:b468;b468/e

cscript.exexcacls.vbs"%SystemRoot%/system32"/r"users"/e

cscript.exexcacls.vbs"%SystemRoot%/System32"/gusers:b468;b468/e

Rem-------------------------------------------

Rem删除D盘的所有的users的访问权限

cscript.exexcacls.vbs"D:"/r"users"/e

cscript.exexcacls.vbs"D:"/r"everyone"/e

cscript.exexcacls.vbs"D:"/r"CREATOROWNER"/e

Rem删除E盘的所有的users的访问权限

cscript.exexcacls.vbs"E:"/r"users"/e

cscript.exexcacls.vbs"E:"/r"everyone"/e

cscript.exexcacls.vbs"E:"/r"CREATOROWNER"/e

Rem删除F盘的所有的users的访问权限

cscript.exexcacls.vbs"F:"/r"users"/e

cscript.exexcacls.vbs"F:"/r"everyone"/e

cscript.exexcacls.vbs"F:"/r"CREATOROWNER"/e

Rem删除C盘Windows下的所有的危险文件夹

attrib%SystemRoot%/Web/printers-s-r-h

del%SystemRoot%Webprinters*.*/s/q/f

rd%SystemRoot%Webprinters/s/q

attrib%SystemRoot%HelpiisHelp-s-r-h

del%SystemRoot%HelpiisHelp*.*/s/q/f

rd%SystemRoot%HelpiisHelp/s/q

attrib%SystemRoot%system32inetsrviisadmpwd-s-r-h

del%SystemRoot%system32inetsrviisadmpwd*.*/s/q/f

rd%SystemRoot%system32inetsrviisadmpwd/s/q

Echo给系统危险文件夹设置权限设定完毕!请按任意键返回并选3继续...

PAUSE>nul

Gotostart

:Service

CLS

MODEcon:COLS=80LINES=18

COLOR70

Echo.

@REMApplicationExperienceLookupService

@REM在应用程序启动时为应用程序处理应用程序兼容性查找请求。

@REM建议:禁用

scconfigAeLookupSvcstart=DISABLED

scstopAeLookupSvc

@REMBackgroundIntelligentTransferService

@REM在后台传输客户端和服务器之间的数据。如果禁用了BITS,一些功能,如WindowsUpdate,就无法正常运行。

@REM建议:禁用

scconfigBITSstart=DISABLED

scstopBITS

@REMDHCPClient

@REM为此计算机注册并更新IP地址。如果此服务停止,计算机将不能接收动态IP地址和DNS更新。如果此服务被禁用,所有明确依赖它的服务都将不能启动。

@REM建议:禁用

scconfigDhcpstart=DISABLED

scstopDhcp

@REMNetworkLocationAwareness(NLA)

@REM收集并保存网络配置和位置信息,并在信息改动时通知应用程序。

@REM建议:禁用

scconfigNlastart=DISABLED

scstopNla

@REMSecondaryLogon

@REM启用替换凭据下的启用进程。如果此服务被终止,此类型登录访问将不可用。如果此服务被禁用,任何依赖它的服务将无法启动。

@REM建议:禁用

scconfigseclogonstart=DISABLED

scstopseclogon

@REMTCP/IPNetBIOSHelper

@REM提供TCP/IP(NetBT)服务上的NetBIOS和网络上客户端的NetBIOS名称解析的支持,从而使用户能够共享文件、打印和登录到网络。如果此服务被停用,这些功能可能不可用。如果此服务被禁用,任何依赖它的服务将无法启动。

@REM建议:禁用

scconfigLmHostsstart=DISABLED

scstopLmHosts

@REMWirelessConfiguration

@REM启用IEEE802.11适配器的自动配置。如果此服务停止,自动配置将不可用。如果此服务被禁用,所有明确依赖它的服务都将不能启动。

@REM建议:禁用

scconfigWZCSVCstart=DISABLED

scstopWZCSVC

@REMDistributedTransactionCoordinator

@REM协调跨多个数据库、消息队列、文件系统等资源管理器的事务。如果停止此服务,则不会发生这些事务。如果禁用此服务,显式依赖此服务的其他服务将无法启动。

@REM建议:禁用

scconfigMSDTCstart=DISABLED

scstopMSDTC

@REMSmartCard(智慧卡)

@REM微软:管理这个计算机所读取智能卡的存取。如果这个服务被停止,这个计算机将无法读取智能卡。如果这个服务被停用,任何明确依存于它的服务将无法启动。

@REM补充:如果你不使用SmartCard,那就可以关了

@REM依存:PlugandPlay

@REM建议:禁用

scconfigSCardSvrstart=DISABLED

scstopSCardSvr

@REMInternetConnectionFirewall(ICF)/InternetConnectionSharing(ICS)[ForXP]

@REM微软:为您的家用网络或小型办公室网络提供网络地址转译、寻址及名称解析服务和/或防止干扰的服务。

@REM补充:如果你不使用因特网联机共享(ICS)或是XP内含的因特网联机防火墙(ICF)你可以关掉

@REM依存:ApplicationLayerGatewayService、NetworkConnections、NetworkLocationAwareness(NLA)、remoteAccessConnectionManager

@REM建议:禁用

scconfigSharedAccessstart=DEMAND

scstopSharedAccess

@REMWindowsImageAcquisition(WIA)(Windows影像取得程序)

@REM微软:为扫描仪和数字相机提供影像撷取服务。

@REM补充:如果扫描仪和数字相机内部具有支持WIA功能的话,那就可以直接看到图档,不需要其它的驱动程序,所以没有扫描仪和数字相机的使用者大可关了

@REM依存:remoteProcedureCall(RPC)

@REM建议:禁用

scconfigstisvcstart=DISABLED

scstopstisvc

@REMMSSoftwareShadowCopyProvider[ForXP]

@REM微软:管理磁盘区阴影复制服务所取得的以软件为主的磁盘区阴影复制。如果停止这个服务,就无法管理以软件为主的磁盘区阴影复制。

@REM补充:如上所说的,用来备份的东西,如MSBackup程序就需要这个服务

@REM依存:remoteProcedureCall(RPC)

@REM建议:禁用

scconfigswprvstart=DISABLED

scstopswprv

当前1/3页123下一页阅读全文

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新DOS/BAT学习
热门DOS/BAT学习
脚本专栏子分类