位置: 编程技术 - 正文

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

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

  • 收到投资款要交企业所得税吗为什么
  • 非独立核算增值税在哪里交
  • 进口货物如何确认
  • 金三财务报表如何更正
  • 从事小额零星经营业务的个人是指
  • 劳务有预付款吗
  • 以前年度资产损失的追补什么意思
  • 上交的项目评审费如何做财务处理呢?
  • 支付收购股权款如何做账
  • 营改增之后餐饮业的税收政策
  • 互联网合同要交社保吗
  • 发票选择确认平台怎么选
  • 工程开票是否需要资质?
  • 个人能否去税务登记
  • 油卡充值属于什么行业
  • 快递公司怎么纳入社保
  • 向境外企业支付技术咨询指导费
  • 两处拿工资的缴税问题
  • 审计费可以抵扣进项吗
  • 没进项发票要交多少税
  • 土地使用权摊销账务处理
  • 利息支出为什么不是经营成本
  • 企业自然人电子税务局怎么申报
  • 飞鱼星路由器信号有点差怎么办
  • 汇算清缴时研发费用加计扣除怎么做账
  • 企业在运行过程中会遇到哪些法律问题
  • 投入资本回报率是总资产报酬率吗
  • 企业注销时当月要缴税吗
  • windows 11 正式
  • php 数字相加
  • 大白菜一键装机教程
  • 展会费用计入什么科目
  • 小规模纳税人的企业所得税怎么算
  • 资产负债表怎么算资产负债率
  • php播放本地音乐
  • 公司修好厂房老板怎么说
  • 实收资本与注册资本之间的关系
  • 最好卖的游戏机排行榜
  • php二维码解码
  • thinkphp框架入门
  • 残保金计入税金及附加合理吗
  • 只有进项税没有销项
  • pytorch的环境配置
  • 报销的时候发票金额大于实际报销的金额
  • 资产支出加权平均数例题
  • 优先股可转让吗
  • 税控盘全额抵扣政策
  • 原材料退库的会计分录
  • mysql_assoc
  • python中返回结果为true
  • 大学生创新创业平台
  • 增值税增量留抵退税计算
  • SQL SERVER中关于exists 和 in的简单分析
  • mysql5.5数据库安装教程
  • 个人所得税征税对象是什么
  • 残保金少申报了怎么办
  • 外经证如何缴税
  • 收入分成的账务处理
  • 车辆保险赔款怎么算
  • 不动产什么时候取得所有权
  • 暂领款是什么意思
  • 预收账款和应收账款可以放在一个账户
  • 个人购汇需要申报吗
  • 个体户不交税会判刑吗?
  • 新建公司需要什么
  • 未取得合法支付凭据和与本单位无关的收入
  • xp系统登录界面登录管理员账号
  • centos7安装过程报错
  • php.ini linux
  • Android platform build guide for Exynos-4412(odroid -X/X2/U2/U3/Q2/Q)
  • webview清除数据
  • js easyui
  • android studio 运行配置
  • 江苏国税电子税局
  • 如何在网上查看自己的征信
  • 四川地方税务 副局长 晓宏
  • 国家税务总局网址
  • 电子税务局开发票流程
  • 公司处理固定资产汽车怎么交税
  • 双休日可以拿房产证吗
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设