[/hide]复制代码
- @echo off
- color 2F
- MODE con: COLS=72 LINES=24
- Title 微软安全套装 Microsoft Security Essentials 安装辅助
- :Start
- cls
- echo.
- echo ========================================================================
- echo ========***************************************************=============
- echo.
- echo 微软安全套装 Microsoft Security Essentials 安装辅助
- echo.
- echo ========***************************************************=============
- echo ========================================================================
- echo.
- echo.
- echo.
- echo ==By 35205==
- echo.
- echo.
- echo.
- Ping -n 4 127.1>nul
- :SetSys
- REM 判断系统类型========
- :renamebat
- if exist %windir%\SysWOW64\*.* (set x=x64&set xM=64 ) else (set x=x86&set xM=32 )
- goto Setup
- REM 安装文件==========================================================================================================================================
- :Setup
- :SetupChoice
- echo.
- echo.
- echo.
- echo.
- echo.
- echo.
- echo.
- echo ========================================================================
- echo.
- echo (1)是 / (2)否 开始安装? 请选择按 1 / 2 / 3(下载地址):
- echo.
- echo.
- echo ========================================================================
- echo.
- set /p SetupChoice=
- if "%SetupChoice%"=="1" goto SetupChoice_Y
- if "%SetupChoice%"=="2" goto SetupChoice_N
- if "%SetupChoice%"=="3" goto SetupChoice_URL
- goto SetupChoice_N
- :SetupChoice_Y
- REM goto SetupChoice_Y_
- REM========================文件命名==========================================
- echo .
- Set Installname=Microsoft MSE-MSEInstall.exe
- ren "%Installname%" mseinstall.exe
- Set mpam-fex64name=Microsoft MSE-mpam-fex64.exe
- ren "%mpam-fex64name%" mpam-fex64.exe
- Set mpam-fename=Microsoft MSE-mpam-fe.exe
- ren "%mpam-fename%" mpam-fe.exe
- Set nis_fullname=Microsoft MSE-nis_full.exe
- ren "%nis_fullname%" nis_full.exe
- Set mpam-dname=Microsoft MSE-mpam-d.exe
- ren "%mpam-dname%" mpam-d.exe
- :SetupChoice_Y_
- echo.
- echo ========================================================================
- echo.
- echo 请确认4个安装包已经按照如下格式放置
- echo.
- echo.
- echo 目录\
- echo X86\mseinstall.exe
- echo \mpam-fex86.exe
- echo \nis_full.exe
- echo \mpam-d.exe
- echo X64\mseinstall.exe
- echo \mpam-fex64.exe
- echo \nis_full.exe
- echo \mpam-d.exe
- echo.
- echo.
- echo ========================================================================
- echo.
- echo.
- ping -n 4 127.1 >nul
- echo.
- echo.
- Rem 开始安装....
- echo 开始安装..................
- if exist "%~dp0\mseinstall.exe" (echo 找到文件.mseinstall... &"%~dp0\mseinstall.exe" /s /runwgacheck /o &echo 已经安装.mseinstall...) else (echo 无法找到 mseinstall.exe .......)
- if %x%#==x64# (goto MPAM-64) else (goto MPAM-32)
- :MPAM-64
- if exist "%~dp0\mpam-fex64.exe" (echo 找到文件.mpam-fex64... &"%~dp0\mpam-fex64.exe" /q &echo 已经安装.mpam-fex64...) else (echo 无法找到 %~dp0\mpam-fex64.exe .......)
- goto Installfull
- :MPAM-32
- if exist "%~dp0\mpam-fe.exe" (echo 找到文件.mpam-fe... &"%~dp0\mpam-fe.exe" /q &echo 已经安装.mpam-fe...) else (echo 无法找到 %~dp0\mpam-fe.exe .......)
- goto Installfull
- :Installfull
- if exist "%~dp0\nis_full.exe" (echo 找到文件.nis_full... &"%~dp0\nis_full.exe" /q &echo 已经安装.nis_full...) else (echo 无法找到 nis_full.exe .......)
- if exist "%~dp0\mpam-d.exe" (echo 找到文件.mpam-d... &"%~dp0\mpam-d.exe" /q &echo 已经安装.mpam-d...) else (echo 无法找到 mpam-d.exe .......)
- ping -n 3 127.1>nul
- Cd %ProgramFiles%
- if exist "%ProgramFiles%\Microsoft Security Client\msseces.exe" (Echo 找到Msseces开始启动... &goto StartMsseces) else (echo 无法找到 Msseces....... &goto REG_Set)
- :StartMsseces
- Echo 找到Msseces开始启动.....
- start "" "%ProgramFiles%\Microsoft Security Client\msseces.exe"
- Echo 找到Msseces开始启动........
- ping -n 5 127.0.0.1 >nul 2>nul
- Echo 找到Msseces开始启动............
- start "" "%ProgramFiles%\Microsoft Security Client\msseces.exe" -hide -runkey
- ::::::Echo ..........................
- ::::::执行立即更新病毒库参数可以用下面的命令
- ::::::Echo 执行立即更新病毒库N...
- ::::::start "" "%ProgramFiles%\Microsoft Security Client\msseces.exe" /update
- ::::::执行更新病毒库后执行快速扫描可以用下面的命令
- ::::::Echo 执行更新病毒库后执行快速扫描N...
- ::::::start "" "%ProgramFiles%\Microsoft Security Client\msseces.exe" /updateandquickscan
- ::::::将Microsoft Security Essentials添加到防火墙允许列表可以用下面的命令
- ::::::Echo 将Microsoft Security Essentials添加到防火墙N...
- ::::::netsh firewall add allowedprogram program="%ProgramFiles%\Microsoft Security Client\msseces.exe" name= "Microsoft Security Essentials" mode=enable
- Echo.
- echo.
- echo.
- echo 启动完成...
- ping -n 3 127.1>nul
- echo.
- GOTO REG_Set
- :SetupChoice_N
- echo.
- echo 不安装....
- echo.
- goto Out
- REM 安装文件
- :SetupChoice_URL
- set MseInstall=正在下载 Microsoft Security Essentials(微软安全套装 %xM% 位)简体中文版安装包...
- echo.
- echo %MseInstall%
- echo MseInstall
- start /wait "iexplorer" http://download.microsoft.com/download/1/E/D/1ED80C09-218B-44D7-B72D-E1451634E72D/ZHCN/amd64/MSEInstall.exe
- Pause
- set MseMPAM-FE=正在下载 Microsoft Security Essentials(微软安全套装 %xM% 位)最新病毒定义库...
- echo.
- echo %MseMPAM-FE%
- echo MseMPAM-FE
- start /wait "iexplorer" http://download.microsoft.com/download/DefinitionUpdates/mpam-fex64.exe
- PAUSE
- set MseNIS_FULL=正在下载 Microsoft Security Essentials(微软安全套装 %xM% 位)最新病毒定义增量库...
- echo.
- echo %MseNIS_FULL%
- echo MseNIS_FULL
- start /wait "iexplorer" http://download.microsoft.com/download/DefinitionUpdates/amd64/nis_full.exe
- Pause
- set MseMPAM-D=正在下载 Microsoft Security Essentials(微软安全套装 %xM% 位)最新网络安全定义库...
- echo.
- echo %MseMPAM-D%
- echo MseMPAM-D
- start /wait "iexplorer" http://download.microsoft.com/download/DefinitionUpdates/amd64/mpam-d.exe
- PAUSE
- Goto setup
- ==========================================================================================================================================
- Rem 优化设置
- :REG_Set
- echo.
- Ping -n 2 127.1>nul
- rem Microsoft Security Essentials 优化设置=============================================================================================================
- :Reg_set_ask
- echo.
- echo ========================================================================
- echo.
- echo (1)是/(2)否 进行Microsoft Security Essentials优化设置?请选择按 1 / 2 :
- echo.
- echo.
- echo ========================================================================
- echo.
- set /p Reg_set_ask=
- if “%Reg_set_ask%”==“1” goto Reg_set_ask_Y
- if “%Reg_set_ask%”==“2” goto Reg_set_ask_N
- goto Reg_set_ask_N
- :Reg_set_ask_Y
- :排除的文件类型(示例)
- echo .......................
- 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
- REM :排除文件和位置(示例)
- echo .......................
- REM reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Paths" /v "E:\\(示例)" /t REG_DWORD /d 0 /f >nul 2>nul
- REM :排除进程名(示例)
- echo .......................
- REM reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Exclusions\Processes" /v "(示例).exe" /t REG_DWORD /d 0 /f >nul 2>nul
- :隔离项目在一个月后自动删除(示例)
- echo .......................
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Quarantine" /v "PurgeItemsAfterDelay" /t REG_DWORD /d 30 /f >nul 2>nul
- :控制 CPU 使用率限制30%(示例)
- echo .......................
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Scan" /v "AvgCPULoadFactor" /t REG_DWORD /d 30 /f >nul 2>nul
- :不扫描存档文件(示例)
- echo .......................
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Scan" /v "DisableArchiveScanning" /t REG_DWORD /d 1 /f >nul 2>nul
- :严重级别(删除操作)(示例)
- echo .......................
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Threats\ThreatSeverityDefaultAction" /v "5" /t REG_DWORD /d 3 /f >nul 2>nul
- :高级别(隔离操作)(示例)
- echo .......................
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Threats\ThreatSeverityDefaultAction" /v "4" /t REG_DWORD /d 2 /f >nul 2>nul
- :中级别(隔离操作)(示例)
- echo .......................
- 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
- :低级别(允许操作)(示例)
- echo .......................
- reg add "HKLM\SOFTWARE\Microsoft\Microsoft Antimalware\Threats\ThreatSeverityDefaultAction" /v "1" /t REG_DWORD /d 6 /f >nul 2>nul
- echo .......................
- echo.
- echo Microsoft Security Essentials 优化设置完成....
- echo.
- ping -n 2 127.1>nul
- echo.
- goto Out
- :Reg_set_ask_N
- echo.
- echo Microsoft Security Essentials 不优化....
- echo.
- ping -n 2 127.1>nul
- echo.
- echo.
- goto Out
- rem Microsoft Security Essentials 优化设置=================================================================================================================
- :Out
- echo.
- echo.
- echo.
- echo 准备退出.....................................
- echo.
- ping -n 5 127.1>nul
- exit
欢迎光临 批处理之家 (http://www.bathome.net/) | Powered by Discuz! 7.2 |