用命令行触发 Microsoft Defender 杀毒扫描

通过 PowerShell 或 MpCmdRun.exe 工具发起快速、全盘、自定义乃至离线引导扫描,不必点开图形界面。

Windows终端安全诊断低风险
在 PowerShell 运行 `Start-MpScan -ScanType QuickScan` 快速扫描,`-ScanType FullScan` 全盘扫描,或 `-ScanType CustomScan -ScanPath "D:\"` 扫描指定文件夹。

01命令

命令
$ Start-MpScan -ScanType QuickScan

02作用说明

Start-MpScan 是 Defender 引擎的 PowerShell 前端,执行是同步的,扫描结束前命令行会一直阻塞。经典替代方案是 Defender 自带的 CLI:`"%ProgramFiles%\Windows Defender\MpCmdRun.exe" -Scan -ScanType 1`(快速)、`-ScanType 2`(全盘)、`-ScanType 3 -File "D:\文件夹"`(自定义路径),加 `-DisableRemediation` 可只检测不处置。对付重启后仍存活的顽固恶意软件,请使用「Windows 安全中心 > 病毒和威胁防护」中的 Microsoft Defender 脱机版扫描,它在 Windows 加载之前运行。检测结果用 `Get-MpThreatDetection` 和 `Get-MpThreat` 查看。

03风险

风险低风险
使用条件No elevation needed for quick/full scans; Defender must be the active antivirus (not replaced by third-party security software).
!注意: 全盘扫描可能持续数小时并重度占用磁盘——生产机器请安排在空闲时段,不要在工作时间中途运行。

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

最后验证: 2026-09-17 · 分类: 安全与隐私

06相关方案