位置: 编程技术 - 正文

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

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

  • 财政的税收
  • 税后经营净利率和营业净利率的区别
  • 单一窗口报关单
  • 网银发工资怎么增员的
  • 以前年度损益调整在利润表中怎么填
  • 固定资产处置残值收入要纳税
  • 企业入统的利弊
  • 计提缴纳印花税怎么做账
  • 债务重组损失是费用吗
  • 国库存款利息收入计入哪个预算收入科目
  • 上季度开的发票这季度冲红怎么做会计分录?
  • 营改增后企业出售使用过的旧车
  • 购买车间用的材料怎么做分录
  • 企业重组中撤资所得税有哪些处理规则?
  • 印花税的计税依据是开票金额吗
  • 收取线路维护费合法吗
  • 发票上传出现手印怎么办
  • 计提的电费和支付电费差额如何调整
  • 工程施工什么时候确认收入
  • 运费计入采购成本会计分录
  • 咨询服务用什么科目
  • 跨年度冲减收入
  • 全资的子公司
  • 财政拨款收入属什么科目
  • 企业所得税汇算清缴补缴税款分录
  • 无偿调入固定资产
  • 以固定资产对外投资影响现金流量吗
  • 银行进账单和现金缴款单的区别
  • php验证源码
  • php中实现文件上传需要用到哪几个函数
  • thinkphp cli
  • 微信账单可以打清单吗
  • 现金流量表中如何考虑折旧费
  • 权益工具与金融负债的转换
  • php文件上传用什么请求方法
  • php二维数组的遍历
  • 软件企业享受增值服务
  • 朝夕教育怎么样
  • 3分钟认识Vue3的v-model
  • php 微信公众号自定义菜单
  • 车险开的发票里有代收车船税吗
  • 费用科目在贷方表示
  • 主营业务收入和营业外收入的区别
  • 红字发票信息表填好后再怎么操作
  • 支付宝对公账户怎么转账
  • 计提了年终奖还能冲回吗
  • 跨国公司海外子公司
  • 跨省市提供建筑服务
  • 劳务发票去哪里开
  • mysql查询语句慢怎么优化
  • 核定征收的企业所得税怎么算
  • 结账与对账的共同意义在于
  • 会计处理的步骤
  • 银行利息收入如何记账
  • 固定资产房屋拆除后如何做帐务处理
  • 差旅费的会计处理
  • 进项税额转出有余额怎么调整
  • 公司三证合一是指哪三证
  • MySQL中interactive_timeout和wait_timeout的区别
  • xp浏览器无法浏览网页
  • fedora最新版本
  • windows.old文件夹有啥用
  • 看视频出现弹幕怎么处理
  • linux中apt-get和yum
  • 1sass.exe是什么程序
  • bd是什么文件
  • uibutton设置圆角
  • extJS中常用的4种Ajax异步提交方式
  • 对用户输入的判断
  • ajax成功不走success
  • perl -p -i
  • 实用的批处理命令
  • javascript怎么用
  • nodejs来一打c++扩展
  • numpy基础知识
  • jquery showloading
  • js 判断
  • 重芳烃闪点70,初馏点是多少
  • 个人所得税网上报税流程
  • 资源税是对在我国
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设