位置: 编程技术 - 正文

批处理设置windows服务器的代码ThecSafe1.9.4第1/3页(批处理设置dns)

编辑:rootadmin
@Echo Off TITLE 常来网服务器高级安全设置器 :start CLS COLOR 1f Rem 使用COLOR命令对控制台输出颜色进行更改 MODE con: COLS= LINES= Rem MODE语句为设定窗体的宽和高 Set tm1=%time:~0,2% Set tm2=%time:~3,2% Set tm3=%time:~6,2% Echo %date% %tm1%点%tm2%分%tm3%秒 Echo ================================ Echo 请选择要进行的操作,然后按回车 Echo ─────────────── Echo. Echo A. 一键搞定/全自动设置服务器 Echo 0. 清理系统垃圾文件 Echo 1. 给系统危险文件设置权限 Echo 2. 给系统危险文件夹设置权限 Echo 3. 系统服务优化 Echo 4. 注册表危险组件删除 Echo 5. 防DDOS洪水攻击处理 Echo 6. 导入常来网专用安全策略 Echo 7. 重启IIS使设置生效 Echo 8. 刷新当前时间 Echo 9. 锁定计算机 Echo L. 注销当前用户 Echo Q. 退出安全设置器 Echo. :cho Set Choice= Set /P Choice=选择: Rem 设定变量"Choice"为用户输入的字符 If Not "%Choice%"=="" Set Choice=%Choice:~0,1% Rem 如果输入大于1位,取第1位,比如输入,则返回值为1 Echo. If /I "%Choice%"=="A" Goto Auto If /I "%Choice%"=="0" Goto Clear If /I "%Choice%"=="1" Goto SetFile If /I "%Choice%"=="2" Goto SetFolder If /I "%Choice%"=="3" Goto Service If /I "%Choice%"=="4" Goto Reg If /I "%Choice%"=="5" Goto Ddos If /I "%Choice%"=="6" Goto Ipsec If /I "%Choice%"=="7" Goto restartiis If /I "%Choice%"=="8" Goto start If /I "%Choice%"=="9" Goto lock If /I "%Choice%"=="L" Goto logoff If /I "%Choice%"=="Q" Goto End Rem 为避免出现返回值为空或含空格而导致程序异常,需在变量外另加双引号 Rem 注意,If语句需要双等于号 Rem 如果输入的字符不是以上数字,将返回重新输入 Echo 选择无效,请重新输入 Echo. Goto cho :Clear CLS MODE con: COLS= LINES= COLOR 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%Local SettingsTemporary Internet Files*.*" del /f /s /q "%userprofile%Local SettingsTemp*.*" del /f /s /q "%userprofile%recent*.*" Echo 清理系统垃圾完成! 请按任意键返回并选1继续... PAUSE >nul Goto start :SetFile CLS MODE con: COLS= LINES= COLOR Echo. Rem 删除系统危险文件的访问权限,只留管理组成员 cscript.exe xcacls.vbs "%SystemDrive%/boot.ini" /G Administrators:F cscript.exe xcacls.vbs "%SystemDrive%/boot.ini" /D Guests:F /E cscript.exe xcacls.vbs "%SystemDrive%/AUTOEXEC.BAT" /G Administrators:F cscript.exe xcacls.vbs "%SystemDrive%/AUTOEXEC.BAT" /D Guests:F /E cscript.exe xcacls.vbs "%SystemDrive%/Program Files/Internet Explorer/iexplore.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemDrive%/Program Files/Internet Explorer/iexplore.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/net.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/net.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/net1.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/net1.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/cmd.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/cmd.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/ftp.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/ftp.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/scrrun.dll" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/scrrun.dll" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/shell.dll" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/shell.dll" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/netstat.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/netstat.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/regedit.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/regedit.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/secedit.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/secedit.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/gpresult.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/gpresult.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/gpupdate.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/gpupdate.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/at.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/at.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/attrib.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/attrib.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/format.com" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/format.com" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/logoff.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/logoff.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/shutdown.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/shutdown.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/telnet.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/telnet.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/wscript.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/wscript.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/doskey.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/doskey.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/help.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/help.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/ipconfig.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/ipconfig.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/nbtstat.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/nbtstat.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/print.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/print.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/xcopy.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/xcopy.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/edit.com" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/edit.com" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/regedt.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/regedt.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/reg.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/reg.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/register.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/register.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/replace.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/replace.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/nwscript.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/nwscript.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/share.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/share.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/ping.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/ping.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/ipsec6.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/ipsec6.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/netsh.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/netsh.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/debug.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/debug.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/route.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/route.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/tracert.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/tracert.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/powercfg.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/powercfg.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/nslookup.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/nslookup.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/arp.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/arp.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/rsh.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/rsh.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/netdde.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/netdde.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/mshta.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/mshta.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/mountvol.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/mountvol.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/tftp.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/tftp.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/setx.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/setx.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/find.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/find.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/finger.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/finger.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/where.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/where.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/regsvr.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/regsvr.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/cacls.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/cacls.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/sc.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/sc.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/shadow.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/shadow.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/runas.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/runas.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/wshom.ocx" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/wshom.ocx" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/wshext.dll" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/wshext.dll" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/shell.dll" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/shell.dll" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/zipfldr.dll" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/zipfldr.dll" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/PCHealth/HelpCtr/Binaries/msconfig.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/PCHealth/HelpCtr/Binaries/msconfig.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/notepad.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/notepad.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/regedit.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/regedit.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/winhelp.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/winhelp.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/winhlp.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/winhlp.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/notepad.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/notepad.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/edlin.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/edlin.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/posix.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/posix.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/atsvc.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/atsvc.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/qbasic.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/qbasic.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/runonce.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/runonce.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/syskey.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/syskey.exe" /D Guests:F /E cscript.exe xcacls.vbs "%SystemRoot%/system/cscript.exe" /G Administrators:F cscript.exe xcacls.vbs "%SystemRoot%/system/cscript.exe" /D Guests:F /E Echo 给系统危险文件设置权限设定完毕! 请按任意键返回并选2继续... PAUSE >nul Goto start :SetFolder CLS MODE con: COLS= LINES= COLOR Echo. Rem 删除C盘所有的Everone权限 cd/ cscript.exe xcacls.vbs "%SystemDrive%" /r "Everyone" /e cscript.exe xcacls.vbs "%SystemRoot%" /r "Everyone" /e @REM "cscript.exe xcacls.vbs "%SystemRoot%/Registration" /r "Everyone" /e " 这个不能去Everyone权限 cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings" /r "Everyone" /e cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users" /r "Everyone" /e cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Documents" /r "Everyone" /e cscript.exe xcacls.vbs "%SystemDrive%/Inetpub/aspnet_client" /r "Everyone" /e cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data/Microsoft" /r "Everyone" /e cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data/Microsoft/HTML Help" /r "Everyone" /e Rem 删除C盘所有的CREATOR OWNER权限 cd/ cscript.exe xcacls.vbs "%SystemRoot%" /r "CREATOR OWNER" /e cscript.exe xcacls.vbs "%SystemDrive%" /r "CREATOR OWNER" /e cscript.exe xcacls.vbs "%SystemRoot%/repair" /r "CREATOR OWNER" /e cscript.exe xcacls.vbs "%SystemRoot%/system" /r "CREATOR OWNER" /e cscript.exe xcacls.vbs "%SystemRoot%/system/wbem" /r "CREATOR OWNER" /e cscript.exe xcacls.vbs "%SystemRoot%/system/config" /r "CREATOR OWNER" /e cscript.exe xcacls.vbs "%SystemDrive%/Program Files" /r "CREATOR OWNER" /e cscript.exe xcacls.vbs "%SystemDrive%/Program Files/WindowsUpdate" /r "CREATOR OWNER" /e cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Documents" /r "CREATOR OWNER" /e cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data" /r "CREATOR OWNER" /e Rem 删除C盘所有的Power Users权限 cd/ cscript.exe xcacls.vbs "%SystemRoot%" /r "Power Users" /e cscript.exe xcacls.vbs "%SystemRoot%/repair" /r "Power Users" /e cscript.exe xcacls.vbs "%SystemRoot%/system" /r "Power Users" /e cscript.exe xcacls.vbs "%SystemRoot%/system/wbem" /r "Power Users" /e cscript.exe xcacls.vbs "%SystemRoot%/system/config" /r "Power Users" /e cscript.exe xcacls.vbs "%SystemDrive%/Program Files" /r "Power Users" /e cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings" /r "Power Users" /e cscript.exe xcacls.vbs "%SystemDrive%/Program Files/WindowsUpdate" /r "Power Users" /e cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users" /r "Power Users" /e cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Documents" /r "Power Users" /e cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data" /r "Power Users" /e cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data/Microsoft" /r "Power Users" /e cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data/Microsoft/HTML Help" /r "Power Users" /e Rem 删除C盘所有的TERMINAL SERVER USER权限 cd/ cscript.exe xcacls.vbs "%SystemDrive%/Program Files" /r "TERMINAL SERVER USER" /e Rem 添加Guests组拒绝权限[IUSR_XXX或某个虚拟主机用户组禁止列目录,可有效防止FSO类木马] cd/ cscript.exe xcacls.vbs "%SystemDrive%/Program Files" /D Guests:1;1 /E cscript.exe xcacls.vbs "%SystemRoot%/repair" /D Guests:1;1 /E cscript.exe xcacls.vbs "%SystemRoot%/system" /D Guests:1;1 /E cscript.exe xcacls.vbs "%SystemRoot%/system/config" /D Guests:1;1 /E cscript.exe xcacls.vbs "%SystemRoot%/system/inetsrv" /D Guests:1;1 /E cscript.exe xcacls.vbs "%SystemRoot%/system/inetsrv/MetaBack" /D Guests:1;1 /E cscript.exe xcacls.vbs "%SystemRoot%/system/inetsrv/ASP Compiled Templates" /D Guests:1;1 /E cscript.exe xcacls.vbs "%SystemRoot%/IIS Temporary Compressed Files" /D Guests:1;1 /E cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data" /D Guests:1;1 /E cscript.exe xcacls.vbs "%SystemRoot%/Microsoft.NET/Framework/v1.1./Temporary ASP.NET Files" /D Guests:1;1 /E cscript.exe xcacls.vbs "%SystemRoot%/Microsoft.NET/Framework/v2.0./Temporary ASP.NET Files" /D Guests:1;1 /E cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data/Microsoft" /D Guests:1;1 /E cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data/Microsoft/Crypto/DSS/achineKeys" /D Guests:1;1 /E cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data/Microsoft/Crypto/RSA/MachineKeys" /D Guests:1;1 /E cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data/Microsoft/HTML Help" /D Guests:1;1 /E Rem 删除C盘的所有的users的访问权限 cd/ cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users" /r "users" /e cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Documents" /r "users" /e cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings/All Users/Application Data" /r "users" /e cscript.exe xcacls.vbs "%SystemDrive%" /r "users" /e cscript.exe xcacls.vbs "%SystemDrive%/Program Files" /r "users" /e cscript.exe xcacls.vbs "%SystemDrive%/Documents and Settings" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/addins" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/AppPatch" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/Connection Wizard" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/Debug" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/Driver Cache" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/Help" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/IIS Temporary Compressed Files" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/java" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/msagent" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/mui" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/repair" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/Resources" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/security" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/system" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/TAPI" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/twain_" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/Web" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/system/3com_dmi" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/system/administration" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/system/Cache" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/system/CatRoot2" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/system/Com" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/system/config" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/system/dhcp" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/system/drivers" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/system/export" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/system/icsxml" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/system/lls" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/system/LogFiles" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/system/MicrosoftPassport" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/system/mui" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/system/oobe" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/system/ShellExt" /r "users" /e @Rem cscript.exe xcacls.vbs "%SystemRoot%/system/wbem" /r "users" /e 这里影响.NET程序的正常运行,所以去掉! Rem 添加IIS_WPG的访问权限 cscript.exe xcacls.vbs "%SystemDrive%" /g IIS_WPG:;b /e cscript.exe xcacls.vbs "%SystemRoot%" /g IIS_WPG:b;b /e cscript.exe xcacls.vbs "%SystemDrive%/Program Files" /g IIS_WPG:r /e cscript.exe xcacls.vbs "%SystemRoot%/Downloaded Program Files" /g IIS_WPG:c /e cscript.exe xcacls.vbs "%SystemRoot%/Help" /g IIS_WPG:c /e cscript.exe xcacls.vbs "%SystemRoot%/IIS Temporary Compressed Files" /g IIS_WPG:c /e cscript.exe xcacls.vbs "%SystemRoot%/Offline Web Pages" /g IIS_WPG:c /e cscript.exe xcacls.vbs "%SystemRoot%/System" /g IIS_WPG:c /e cscript.exe xcacls.vbs "%SystemRoot%/Tasks" /g IIS_WPG:c /e cscript.exe xcacls.vbs "%SystemRoot%/Web" /g IIS_WPG:c /e Rem 添加iis_wpg的访问权限[装了MACFEE的软件专用] Rem cscript.exe xcacls.vbs "%SystemDrive%/Program Files/Network Associates" /g IIS_WPG:r /e Rem 添加users的访问权限 cscript.exe xcacls.vbs "%SystemRoot%/temp" /g Everyone:m /e cscript.exe xcacls.vbs "%SystemDrive%/Program Files/Common Files" /g Users:r /e cscript.exe xcacls.vbs "%SystemRoot%/Microsoft.NET/Framework" /g users:b;b /e Rem 禁止[列出文件夹 / 读取数据]此权限出现 Rem ------------------------------------------- Rem 添加Users的访问权限[装了PHP的服务器专用] cscript.exe xcacls.vbs "C:php5" /g users:b;b /e cscript.exe xcacls.vbs "%SystemRoot%/system" /r "users" /e cscript.exe xcacls.vbs "%SystemRoot%/System" /g users:b;b /e Rem ------------------------------------------- Rem 删除D盘的所有的users的访问权限 cscript.exe xcacls.vbs "D:" /r "users" /e cscript.exe xcacls.vbs "D:" /r "everyone" /e cscript.exe xcacls.vbs "D:" /r "CREATOR OWNER" /e Rem 删除E盘的所有的users的访问权限 cscript.exe xcacls.vbs "E:" /r "users" /e cscript.exe xcacls.vbs "E:" /r "everyone" /e cscript.exe xcacls.vbs "E:" /r "CREATOR OWNER" /e Rem 删除F盘的所有的users的访问权限 cscript.exe xcacls.vbs "F:" /r "users" /e cscript.exe xcacls.vbs "F:" /r "everyone" /e cscript.exe xcacls.vbs "F:" /r "CREATOR OWNER" /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%systeminetsrviisadmpwd -s -r -h del %SystemRoot%systeminetsrviisadmpwd*.* /s /q /f rd %SystemRoot%systeminetsrviisadmpwd /s /q Echo 给系统危险文件夹设置权限设定完毕! 请按任意键返回并选3继续... PAUSE >nul Goto start :Service CLS MODE con: COLS= LINES= COLOR Echo. @REM Application Experience Lookup Service @REM 在应用程序启动时为应用程序处理应用程序兼容性查找请求。 @REM 建议: 禁用 sc config AeLookupSvc start= DISABLED sc stop AeLookupSvc @REM Background Intelligent Transfer Service @REM 在后台传输客户端和服务器之间的数据。如果禁用了 BITS,一些功能,如 Windows Update,就无法正常运行。 @REM 建议: 禁用 sc config BITS start= DISABLED sc stop BITS @REM DHCP Client @REM 为此计算机注册并更新 IP 地址。如果此服务停止,计算机将不能接收动态 IP 地址和 DNS 更新。如果此服务被禁用,所有明确依赖它的服务都将不能启动。 @REM 建议: 禁用 sc config Dhcp start= DISABLED sc stop Dhcp @REM Network Location Awareness (NLA) @REM 收集并保存网络配置和位置信息,并在信息改动时通知应用程序。 @REM 建议: 禁用 sc config Nla start= DISABLED sc stop Nla @REM Secondary Logon @REM 启用替换凭据下的启用进程。如果此服务被终止,此类型登录访问将不可用。如果此服务被禁用,任何依赖它的服务将无法启动。 @REM 建议: 禁用 sc config seclogon start= DISABLED sc stop seclogon @REM TCP/IP NetBIOS Helper @REM 提供 TCP/IP (NetBT) 服务上的 NetBIOS 和网络上客户端的 NetBIOS 名称解析的支持,从而使用户能够共享文件、打印和登录到网络。如果此服务被停用,这些功能可能不可用。如果此服务被禁用,任何依赖它的服务将无法启动。 @REM 建议: 禁用 sc config LmHosts start= DISABLED sc stop LmHosts @REM Wireless Configuration @REM 启用 IEEE . 适配器的自动配置。如果此服务停止,自动配置将不可用。如果此服务被禁用,所有明确依赖它的服务都将不能启动。 @REM 建议: 禁用 sc config WZCSVC start= DISABLED sc stop WZCSVC @REM Distributed Transaction Coordinator @REM 协调跨多个数据库、消息队列、文件系统等资源管理器的事务。如果停止此服务,则不会发生这些事务。如果禁用此服务,显式依赖此服务的其他服务将无法启动。 @REM 建议: 禁用 sc config MSDTC start= DISABLED sc stop MSDTC @REM Smart Card (智慧卡) @REM 微软:管理这个计算机所读取智能卡的存取。如果这个服务被停止,这个计算机将无法读取智能卡。如果这个服务被停用,任何明确依存于它的服务将无法启动。 @REM 补充: 如果你不使用 Smart Card ,那就可以关了 @REM 依存: Plug and Play @REM 建议: 禁用 sc config SCardSvr start= DISABLED sc stop SCardSvr @REM Internet Connection Firewall (ICF) / Internet Connection Sharing (ICS)[For XP] @REM 微软:为您的家用网络或小型办公室网络提供网络地址转译、寻址及名称解析服务和/或防止干扰的服务。 @REM 补充: 如果你不使用因特网联机共享(ICS)或是 XP 内含的因特网联机防火墙(ICF)你可以关掉 @REM 依存: Application Layer Gateway Service、Network Connections、Network Location Awareness(NLA)、remote Access Connection Manager @REM 建议: 禁用 sc config SharedAccess start= DEMAND sc stop SharedAccess @REM Windows Image Acquisition (WIA) (Windows影像取得程序) @REM 微软: 为扫描仪和数字相机提供影像撷取服务。 @REM 补充:如果扫描仪和数字相机内部具有支持WIA功能的话,那就可以直接看到图档,不需要其它的驱动程序,所以没有扫描仪和数字相机的使用者大可关了 @REM 依存:remote Procedure Call (RPC) @REM 建议: 禁用 sc config stisvc start= DISABLED sc stop stisvc @REM MS Software Shadow Copy Provider[For XP] @REM 微软:管理磁盘区阴影复制服务所取得的以软件为主的磁盘区阴影复制。如果停止这个服务,就无法管理以软件为主的磁盘区阴影复制。 @REM 补充: 如上所说的,用来备份的东西,如 MS Backup 程序就需要这个服务 @REM 依存:remote Procedure Call (RPC) @REM 建议: 禁用 sc config swprv start= DISABLED sc stop swprv

推荐整理分享批处理设置windows服务器的代码ThecSafe1.9.4第1/3页(批处理设置dns),希望有所帮助,仅作参考,欢迎阅读内容。

批处理设置windows服务器的代码ThecSafe1.9.4第1/3页(批处理设置dns)

文章相关热门搜索词:批处理设置dns,批处理设置变量,批处理设置屏保时间,批处理设置环境变量,批处理设置ip,批处理设置默认打印机,批处理设置默认打印机,批处理设置屏保,内容如对您有帮助,希望把文章链接给更多的朋友!

服务器常用批处理代码 原创 将下面的内容保存为sqlreboot.bat,然后添加到计划任务里,就可以实现一段时间后重启sqlserver服务器了,防止sqlserver经常占用内存过高,导致网页无法打开

利用mshta调用运行js或vbs的 命令行下:mshtajavascript:window.execScript("msgBox('helloyouniao'):window.close","vbs");mshtavbscript:window.execScript("alert('helloyouniao');","javascript")

DOS命令 Interlnk、Intersvr命令使用说明 [用法]DOS新增支持网络的功能,它可以使两台电脑通过并口线或串口线相联组成简易的网络使用interlnk必须在config.sys中增添一句:device=c:dosinterlnk并

标签: 批处理设置dns

本文链接地址:https://www.jiuchutong.com/biancheng/376886.html 转载请保留说明!

上一篇:dos下用recover修复损坏的TXT文件(如何用dos修复引导)

下一篇:服务器常用批处理代码 原创(常用服务器配置)

  • 什么是库存现金的盘亏
  • 交易性金融资产属于什么科目
  • 个税申报怎样作废
  • 个体经营所得税核定征收2023标准
  • 商业汇票到期没有收到款
  • 职工福利费专票账务处理
  • 税控盘上报
  • 小企业会计准则适用于哪些企业
  • 地下建筑房产税减免优惠政策
  • 工程材料增值税税率2023年
  • 房产税原价包括地价吗
  • 物流辅助服务属于什么项目
  • 贴息收入什么意思
  • 房产税申报后多久缴纳税款
  • 福利费要交个人税吗
  • 二手房分析总结范文
  • 销售退回跨年所得税如何做账?
  • 增值税普通发票税率
  • 免税发票备注栏
  • 对公账户开通网银有什么好处
  • 红字发票不小心点了暂存怎么办
  • 19年入职19年离职
  • 合理损耗算入账价值吗
  • 未结转是什么意思
  • 合作社未按时报税怎么处理?
  • 房子按季度收取租金,怎么交房产税
  • 出纳能不能兼开专票
  • PHP:Memcached::getStats()的用法_Memcached类
  • 公网访问内网主机
  • win7系统无法启动怎么处理
  • php://filter协议
  • 餐饮类发票
  • 商贸公司销货怎么做会计分录
  • PHP:imagecolormatch()的用法_GD库图像处理函数
  • 委托加工不提供原材料会计分录
  • mysql_escape_string()函数用法分析
  • ls -lh命令
  • 哪些费用发票可以抵扣企业所得税
  • 持有期间公允价值变动的科目归属
  • 个人工程款收入算是工资流水吗
  • python根据键输出值
  • 让渡资产使用权收入计入什么科目
  • 分期收款方式确认收入的时间
  • win2008安装sql2008教程
  • 员工辞退补偿金计算
  • 小微企业全年营业额不能超过多少
  • 什么叫房屋租购同权
  • 土地使用税是新征税吗
  • 销售商品发生的销售退回计入什么科目
  • 存货报废计入
  • 进项税销项税增值税的区别
  • 免税蔬菜交企业所得税吗
  • 研发支出是科目吗
  • 小规模纳税人如何缴纳企业所得税
  • 原材料暂估的账务处理
  • 一次性购买多张火车票
  • SQL语句查询数据库账号和权限
  • centos配置vps
  • wp7.8升级wp8
  • ghost重装步骤
  • asm是啥
  • xp系统本地用户和组在哪里
  • 电脑取消开机密码显示不能改
  • winxp文件夹选项
  • keyemain.exe是什么
  • 东芝笔记本配件
  • win8.1拨号上网
  • win8系统怎么设置桌面
  • win8.1怎么样
  • opengl自学
  • bootstrap怎样为进度条添加动画
  • jQuery实现checkbox即点即改批量删除及中间遇到的坑
  • cocos2dx减少内存开销
  • js解析机制
  • unity程序基础框架
  • android studio绑定按钮
  • 安徽省电子税务局怎么添加办税人员
  • 资源税属于国税还是地税
  • 国家税务总局上海税务局(个人)
  • 北京市朝阳区地税
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设