[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[安全相关] 静默方式下载、安装、卸载Microsoft Security Essentials 微软安全套装(便携版)

Microsoft Security Essentials 微软安全套装(便携版)
代码本身没有技术含量,事在人为,一切简化操作罢了
因为是安全软件所以附件里 卸载.vbe,停止实时防护.vbe 经过加密处理了,不然被某些流氓杀软厂商利用的^_^
  1. @echo off
  2. if not exist "%~dp0wget.exe" (echo 本脚本需要命令提示符下载工具wget.exe支持&echo 下载地址:http://users.ugent.be/~bpuype/wget/wget.exe&pause>nul)
  3. call :reg_
  4. if exist %windir%\SysWOW64\*.* (set x=x64&set xM=64) else (set x=x86&set xM=32)
  5. set mseM0=正在下载 Microsoft Security Essentials(微软安全套装 %xM% 位)简体中文版...
  6. set mseM1=正在下载 Microsoft Security Essentials(微软安全套装 %xM% 位)最新病毒定义库...
  7. set mseM2=正在下载 Microsoft Security Essentials(微软安全套装 %xM% 位)最新病毒定义增量库...
  8. set nisM1=正在下载 Microsoft Security Essentials(微软安全套装 %xM% 位)最新网络安全定义库...
  9. set setupM=正在安装 Microsoft Security Essentials(微软安全套装 %xM% 位)
  10. md %x%>nul 2>nul
  11. call :%x%
  12. cls&echo.&echo %setupM%
  13. "%~dp0%x%\mseinstall.exe" /s /runwgacheck /o
  14. if %x%#==x64# ("%~dp0%x%\mpam-fex64.exe" /q) else ("%~dp0%x%\mpam-fe.exe" /q)
  15. "%~dp0%x%\nis_full.exe" /q
  16. "%~dp0%x%\mpam-d.exe" /q
  17. start "" "%ProgramFiles%\Microsoft Security Client\msseces.exe"
  18. ping -n 5 127.0.0.1 >nul 2>nul
  19. start "" "%ProgramFiles%\Microsoft Security Client\msseces.exe" -hide -runkey
  20. goto:eof
  21. ::::::执行立即更新病毒库参数可以用下面的命令
  22. ::::::start "" "%ProgramFiles%\Microsoft Security Client\msseces.exe" /update
  23. ::::::执行更新病毒库后执行快速扫描可以用下面的命令
  24. ::::::start "" "%ProgramFiles%\Microsoft Security Client\msseces.exe" /updateandquickscan
  25. ::::::将Microsoft Security Essentials添加到防火墙允许列表可以用下面的命令
  26. ::::::netsh firewall add allowedprogram program="%ProgramFiles%\Microsoft Security Client\msseces.exe" name= "Microsoft Security Essentials" mode=enable
  27. :x86
  28. setlocal enabledelayedexpansion
  29. 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
  30. if not exist %x%\mpam-fe.exe (
  31.     cls&echo.&echo %mseM1%&wget.exe -N -P %x% http://download.microsoft.com/download/DefinitionUpdates/mpam-fe.exe
  32.     ) else (
  33.         call :choice_
  34.         if /i !choice!#==y# cls&echo.&echo %mseM1%&wget.exe -N -P %x% http://download.microsoft.com/download/DefinitionUpdates/mpam-fe.exe
  35. )
  36. cls&echo.&echo %mseM2%&wget.exe -N -P %x% http://download.microsoft.com/download/DefinitionUpdates/x86/mpam-d.exe
  37. cls&echo.&echo %nisM1%&wget.exe -N -P %x% http://download.microsoft.com/download/DefinitionUpdates/x86/nis_full.exe
  38. endlocal&goto:eof
  39. :x64
  40. setlocal enabledelayedexpansion
  41. 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
  42. if not exist %x%\mpam-fex64.exe (
  43.     cls&echo.&echo %mseM1%&wget.exe -N -P %x% http://download.microsoft.com/download/DefinitionUpdates/mpam-fex64.exe
  44.     ) else (
  45.         call :choice_
  46.         if /i !choice!#==y# cls&echo.&echo %mseM1%&wget.exe -N -P %x% http://download.microsoft.com/download/DefinitionUpdates/mpam-fex64.exe
  47. )
  48. cls&echo.&echo %mseM2%&wget.exe -N -P %x% http://download.microsoft.com/download/DefinitionUpdates/amd64/nis_full.exe
  49. cls&echo.&echo %nisM1%&wget.exe -N -P %x% http://download.microsoft.com/download/DefinitionUpdates/amd64/mpam-d.exe
  50. endlocal&goto:eof
  51. :choice_
  52. cls&echo.
  53. set /p choice=是否更新本地病毒定义离线包?(下载持续5~10分钟)按Y/N:
  54. if defined choice (set choice=!choice:~0,1!)
  55. goto:eof
  56. :reg_
  57. rem Microsoft Security Essentials 优化设置
  58. :排除的文件类型
  59. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Extensions" /v "cab" /t REG_DWORD /d 0 /f >nul 2>nul
  60. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Extensions" /v "rar" /t REG_DWORD /d 0 /f >nul 2>nul
  61. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Extensions" /v "zip" /t REG_DWORD /d 0 /f >nul 2>nul
  62. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Extensions" /v "z" /t REG_DWORD /d 0 /f >nul 2>nul
  63. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Extensions" /v "7z" /t REG_DWORD /d 0 /f >nul 2>nul
  64. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Extensions" /v "iso" /t REG_DWORD /d 0 /f >nul 2>nul
  65. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Extensions" /v "img" /t REG_DWORD /d 0 /f >nul 2>nul
  66. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Extensions" /v "wim" /t REG_DWORD /d 0 /f >nul 2>nul
  67. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Extensions" /v "vhd" /t REG_DWORD /d 0 /f >nul 2>nul
  68. :排除文件和位置
  69. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Paths" /v "E:\\Backup" /t REG_DWORD /d 0 /f >nul 2>nul
  70. :排除进程名
  71. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Processes" /v "wget.exe" /t REG_DWORD /d 0 /f >nul 2>nul
  72. :隔离项目在一个月后自动删除
  73. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Quarantine" /v "PurgeItemsAfterDelay" /t REG_DWORD /d 30 /f >nul 2>nul
  74. :控制 CPU 使用率限制30%
  75. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Scan" /v "AvgCPULoadFactor" /t REG_DWORD /d 30 /f >nul 2>nul
  76. :不扫描存档文件
  77. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Scan" /v "DisableArchiveScanning" /t REG_DWORD /d 1 /f >nul 2>nul
  78. :严重级别(删除操作)
  79. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Threats\ThreatSeverityDefaultAction" /v "5" /t REG_DWORD /d 3 /f >nul 2>nul
  80. :高级别(隔离操作)
  81. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Threats\ThreatSeverityDefaultAction" /v "4" /t REG_DWORD /d 2 /f >nul 2>nul
  82. :中级别(隔离操作)
  83. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Threats\ThreatSeverityDefaultAction" /v "3" /t REG_DWORD /d 2 /f >nul 2>nul
  84. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Threats\ThreatSeverityDefaultAction" /v "2" /t REG_DWORD /d 2 /f >nul 2>nul
  85. :低级别(允许操作)
  86. reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Threats\ThreatSeverityDefaultAction" /v "1" /t REG_DWORD /d 6 /f >nul 2>nul
  87. goto:eof
复制代码
http://pan.baidu.com/share/link?shareid=4054546978&uk=1124163200

感谢分享,非常管用!

TOP

雖然沒什麼再用 微軟的
但還是支持下

TOP

Microsoft Security Essentials 微软安全套装(便携版)学习了......

TOP

只听说过MpCmdRun.exe有参数支持,第一次知道msseces.exe也支持参数,楼主能给出详细的参数说明吗?网上好像没有这方面的资料。

TOP

返回列表