位置: 编程技术 - 正文

批处理设置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修复引导)

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

  • 预缴增值税是否要预缴企业所得税
  • 汇票签收后可以撤回吗
  • 付国外专利费用需办什么手续
  • 公司滴滴发票是什么意思
  • 人员工资成本占收入多少合适,占总成本多少合适
  • 企业所得税的利润总额是利润表中的哪个数
  • 复式记账法哪本书提到过?
  • 物业公司哪些费用需要公示
  • 怎么不用关税
  • 多缴了附加税现金怎么办
  • 转售水的税率
  • 未缴纳个人所得税承诺书模板
  • 发票添加商品编码怎么填
  • 劳务税在地税局开还是国税局
  • 一般纳税人企业所得税计算公式
  • 购买理财产品会损失本金吗
  • 企业所得税多交了必须退税吗
  • 工程项目关闭
  • 企业支付员工的工资
  • 外币应收账款汇兑损失计入
  • 处理固定资产开什么发票
  • 金蝶采购发票怎么红冲
  • 租个人房屋办公怎么租
  • 个人所得税适合月度税率表有哪些
  • 月销售额3万以下免征
  • 维修是几个点的税率
  • 小规模纳税人增值税免税政策
  • 核定征收印花税计算公式
  • 生产成本怎样结转科目明细
  • 为什么win7系统用不了谷歌浏览器了
  • 股东撤资属于什么科目
  • win10任务栏还原到下边
  • 用科目汇总表怎么登记总账
  • 贸易公司的采购
  • php激活码永久
  • 微信小程序实现灯泡开关效果
  • 分公司注销,总公司账务处理
  • 小规模纳税人未开票收入如何填申报表
  • 分公司改为子公司的所得税业务处理?
  • 商业折扣的会计分录
  • mongodb用户权限
  • 发票商品分类
  • 小额支出的两种形式
  • 矿泉水发票能否抵税
  • 发出商品的增值税
  • 企业收到投资款应贷记什么账户
  • 银行电子承兑到期了怎么兑现操作
  • 年底要结转净利润怎么算
  • 应付职工薪酬的账务处理
  • 简易办法征收增值税有几种情况
  • 材料按计划成本计价下,外购材料结算
  • 房地产增值税发票是什么意思
  • 员工宿舍发生事故赔偿吗
  • 会计信息不采集可以考初级吗
  • 企业会计准则和小企业准则的区别
  • 支付宝里的收入和支出明细能查多久的?
  • 哪个行业的会计最难
  • 存货明细账余额合计与存货总账余额相同
  • 无形资产的商誉是什么
  • mysql第五章上机
  • xbox无法连接无线网络
  • linux如何调出鼠标
  • u大师教程
  • win7电脑能登qq但打不开网页怎么办
  • mac自带计算器
  • ksysslim.exe是什么
  • cocos设计模式
  • html用法
  • js动态添加dom
  • eclipse 不同工程中文乱码问题(可对文件以及工程单独设置)
  • jquery插件ajaxupload实现文件上传操作
  • jquery示例
  • 用nodejs搭建服务器
  • jquery属性选择器的基本
  • 哪个机场离东莞樟木头最近
  • 车位办房产证需交多少税
  • 供暖企业所涉及的行业
  • 广东省税务登记网
  • 税务副处级竞争上岗笔试题
  • 重庆税务局发票作废
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设