位置: 编程技术 - 正文

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

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

  • 个人所得税清算怎么操作
  • 非居民个人利息所得个税税率
  • 对方给我公司开的红字发票如何查询
  • 商场联营扣率
  • 代收代付保险费的差额可以放入营业外收入么
  • 缴纳契约计税依据包含增值税吗
  • 冲红的专票要给购买方吗
  • 资产负债表期初和期末的关系
  • 装水表财务是什么费用
  • 自产自销发票可以抵扣增值税发票吗
  • 事业单位缴纳增值税标准
  • 发票认证当月必须抵扣吗
  • 广告传媒公司安全生产标准化
  • 完全发生在境外的服务增值税
  • 贷款利息增值税发票
  • 国税网不能打印,怎么设置
  • 纳税人转让2016年以后的土地使用权
  • 外贸企业代理出口销售业务发生的费用
  • 企业会计制度怎么备案
  • 搞金融的企业
  • 发生工伤事故先怎么办
  • 税务非正常户罚款多少
  • 工资计提不发放工资个税
  • 企业一年零申报怎么办
  • 预付工程款计入在建工程吗
  • 未开票收入跨年可以冲回吗
  • 优先股股息发放是啥意思
  • php中的事务使用是什么
  • 销售补差是怎么算的
  • ipad哪款最贵
  • php和mysql web开发怎么样
  • yolov5模型中git的作用
  • 阿尔瓦罗西萨
  • framework怎么用
  • 旧设备换新设备会计分录
  • 普莱斯德
  • thinkphp jquery实现图片上传和预览效果
  • uniapp新建项目
  • 视觉slam ba
  • 用流程图的形式写出视觉的形成过程
  • 预付采购材料款60000元
  • 长期股权投资权益法转成本法
  • 股东之间股权转让需要股东会决议吗
  • 销售收入是营业总收入么
  • dedecms转zblog
  • 融资交易的会计处理
  • HTTP/1.1 XCache header field
  • 购辅助材料会计分录
  • 记账凭证去根据什么填制
  • 小规模纳税人与一般纳税人的区别表现在小规模纳税人
  • 异地项目增值税要异地缴纳吗
  • 个体工商户要做账报税吗
  • 土地使用权被政府收回没有注销怎么样缴土地使用税
  • 计提加计抵减
  • 补缴的土地价款怎么算费用
  • 银行承兑汇票套利案例
  • 库存商品期末余额怎么计算
  • 上月暂估的成本这月收到票怎么做
  • 报销原材料运输费怎么算
  • 冲销坏账怎么做分录
  • 建筑企业城建税和教育费附加怎么算
  • 小企业固定资产折旧方法
  • 购入固定资产会计处理
  • 理财中的非保本是什么意思
  • 营改增问题解答
  • 私营公司的钱怎么拿出来
  • 简单介绍春节的风俗
  • win8系统c盘占用多大
  • win10怎么关闭防火系统
  • osx 10.9
  • linux图形界面与命令行
  • 不经过回收站直接删除文件的操作是
  • unity血条slider
  • html中的表格
  • shell脚本的实现
  • node.jsexpress
  • 朵朵舞百科
  • 福建省国税局
  • 原单位已交社保,新单位怎么办
  • 惠济区第五中学怎么样
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设