标题: [安全相关] 静默方式下载、安装、卸载Microsoft Security Essentials 微软安全套装(便携版) [打印本页]
作者: fastslz 时间: 2011-4-18 19:54 标题: 静默方式下载、安装、卸载Microsoft Security Essentials 微软安全套装(便携版)
Microsoft Security Essentials 微软安全套装(便携版)
代码本身没有技术含量,事在人为,一切简化操作罢了
因为是安全软件所以附件里 卸载.vbe,停止实时防护.vbe 经过加密处理了,不然被某些流氓杀软厂商利用的^_^- @echo off
- if not exist "%~dp0wget.exe" (echo 本脚本需要命令提示符下载工具wget.exe支持&echo 下载地址:http://users.ugent.be/~bpuype/wget/wget.exe&pause>nul)
- call :reg_
- if exist %windir%\SysWOW64\*.* (set x=x64&set xM=64) else (set x=x86&set xM=32)
- set mseM0=正在下载 Microsoft Security Essentials(微软安全套装 %xM% 位)简体中文版...
- set mseM1=正在下载 Microsoft Security Essentials(微软安全套装 %xM% 位)最新病毒定义库...
- set mseM2=正在下载 Microsoft Security Essentials(微软安全套装 %xM% 位)最新病毒定义增量库...
- set nisM1=正在下载 Microsoft Security Essentials(微软安全套装 %xM% 位)最新网络安全定义库...
- set setupM=正在安装 Microsoft Security Essentials(微软安全套装 %xM% 位)
-
- md %x%>nul 2>nul
- call :%x%
- cls&echo.&echo %setupM%
- "%~dp0%x%\mseinstall.exe" /s /runwgacheck /o
- if %x%#==x64# ("%~dp0%x%\mpam-fex64.exe" /q) else ("%~dp0%x%\mpam-fe.exe" /q)
- "%~dp0%x%\nis_full.exe" /q
- "%~dp0%x%\mpam-d.exe" /q
- start "" "%ProgramFiles%\Microsoft Security Client\msseces.exe"
- ping -n 5 127.0.0.1 >nul 2>nul
- start "" "%ProgramFiles%\Microsoft Security Client\msseces.exe" -hide -runkey
- goto:eof
- ::::::执行立即更新病毒库参数可以用下面的命令
- ::::::start "" "%ProgramFiles%\Microsoft Security Client\msseces.exe" /update
- ::::::执行更新病毒库后执行快速扫描可以用下面的命令
- ::::::start "" "%ProgramFiles%\Microsoft Security Client\msseces.exe" /updateandquickscan
- ::::::将Microsoft Security Essentials添加到防火墙允许列表可以用下面的命令
- ::::::netsh firewall add allowedprogram program="%ProgramFiles%\Microsoft Security Client\msseces.exe" name= "Microsoft Security Essentials" mode=enable
-
- :x86
- setlocal enabledelayedexpansion
- if not exist %x%\mseinstall.exe cls&echo.&echo %mseM0%&wget.exe -N -P %x% http://download.microsoft.com/download/1/E/D/1ED80C09-218B-44D7-B72D-E1451634E72D/zh-cn/mseinstall.exe
- if not exist %x%\mpam-fe.exe (
- cls&echo.&echo %mseM1%&wget.exe -N -P %x% http://download.microsoft.com/download/DefinitionUpdates/mpam-fe.exe
- ) else (
- call :choice_
- if /i !choice!#==y# cls&echo.&echo %mseM1%&wget.exe -N -P %x% http://download.microsoft.com/download/DefinitionUpdates/mpam-fe.exe
- )
- cls&echo.&echo %mseM2%&wget.exe -N -P %x% http://download.microsoft.com/download/DefinitionUpdates/x86/mpam-d.exe
- cls&echo.&echo %nisM1%&wget.exe -N -P %x% http://download.microsoft.com/download/DefinitionUpdates/x86/nis_full.exe
- endlocal&goto:eof
-
- :x64
- setlocal enabledelayedexpansion
- if not exist %x%\mseinstall.exe cls&echo.&echo %mseM0%&wget.exe -N -P %x% http://download.microsoft.com/download/1/E/D/1ED80C09-218B-44D7-B72D-E1451634E72D/zh-cn/amd64/mseinstall.exe
- if not exist %x%\mpam-fex64.exe (
- cls&echo.&echo %mseM1%&wget.exe -N -P %x% http://download.microsoft.com/download/DefinitionUpdates/mpam-fex64.exe
- ) else (
- call :choice_
- if /i !choice!#==y# cls&echo.&echo %mseM1%&wget.exe -N -P %x% http://download.microsoft.com/download/DefinitionUpdates/mpam-fex64.exe
- )
- cls&echo.&echo %mseM2%&wget.exe -N -P %x% http://download.microsoft.com/download/DefinitionUpdates/amd64/nis_full.exe
- cls&echo.&echo %nisM1%&wget.exe -N -P %x% http://download.microsoft.com/download/DefinitionUpdates/amd64/mpam-d.exe
- endlocal&goto:eof
-
- :choice_
- cls&echo.
- set /p choice=是否更新本地病毒定义离线包?(下载持续5~10分钟)按Y/N:
- if defined choice (set choice=!choice:~0,1!)
- goto:eof
-
- :reg_
- rem Microsoft Security Essentials 优化设置
- :排除的文件类型
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Extensions" /v "cab" /t REG_DWORD /d 0 /f >nul 2>nul
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Extensions" /v "rar" /t REG_DWORD /d 0 /f >nul 2>nul
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Extensions" /v "zip" /t REG_DWORD /d 0 /f >nul 2>nul
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Extensions" /v "z" /t REG_DWORD /d 0 /f >nul 2>nul
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Extensions" /v "7z" /t REG_DWORD /d 0 /f >nul 2>nul
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Extensions" /v "iso" /t REG_DWORD /d 0 /f >nul 2>nul
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Extensions" /v "img" /t REG_DWORD /d 0 /f >nul 2>nul
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Extensions" /v "wim" /t REG_DWORD /d 0 /f >nul 2>nul
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Extensions" /v "vhd" /t REG_DWORD /d 0 /f >nul 2>nul
- :排除文件和位置
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Paths" /v "E:\\Backup" /t REG_DWORD /d 0 /f >nul 2>nul
- :排除进程名
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Processes" /v "wget.exe" /t REG_DWORD /d 0 /f >nul 2>nul
- :隔离项目在一个月后自动删除
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Quarantine" /v "PurgeItemsAfterDelay" /t REG_DWORD /d 30 /f >nul 2>nul
- :控制 CPU 使用率限制30%
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Scan" /v "AvgCPULoadFactor" /t REG_DWORD /d 30 /f >nul 2>nul
- :不扫描存档文件
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Scan" /v "DisableArchiveScanning" /t REG_DWORD /d 1 /f >nul 2>nul
- :严重级别(删除操作)
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Threats\ThreatSeverityDefaultAction" /v "5" /t REG_DWORD /d 3 /f >nul 2>nul
- :高级别(隔离操作)
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Threats\ThreatSeverityDefaultAction" /v "4" /t REG_DWORD /d 2 /f >nul 2>nul
- :中级别(隔离操作)
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Threats\ThreatSeverityDefaultAction" /v "3" /t REG_DWORD /d 2 /f >nul 2>nul
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Threats\ThreatSeverityDefaultAction" /v "2" /t REG_DWORD /d 2 /f >nul 2>nul
- :低级别(允许操作)
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Threats\ThreatSeverityDefaultAction" /v "1" /t REG_DWORD /d 6 /f >nul 2>nul
- goto:eof
复制代码
http://pan.baidu.com/share/link?shareid=4054546978&uk=1124163200
作者: firefly 时间: 2011-4-18 22:49
只听说过MpCmdRun.exe有参数支持,第一次知道msseces.exe也支持参数,楼主能给出详细的参数说明吗?网上好像没有这方面的资料。
作者: 34205 时间: 2015-1-18 12:15
Microsoft Security Essentials 微软安全套装(便携版)学习了......
作者: 飛雪 时间: 2015-2-27 07:58
雖然沒什麼再用 微軟的
但還是支持下
作者: gwaijyut 时间: 2024-5-30 23:43
感谢分享,非常管用!
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |