Run a Windows Defender scan via command line
Windows Defender Antivirus has a command line utility.
"C:\Program Files\Windows Defender\MpCmdRun.exe" -scan -scantype 1
Scan types:
| 1 | quick scan |
| 2 | full scan |
| 3 | custom file/directory scan (must specify a path via the -File parameter) |
Other interesting parameters:
-Restore -ListAlllist all items that were quarantined-SignatureUpdateruns signature updates
-? lists all of the available options.
PowerShell also makes available the following equivalent cmdlets (among others):
Start-MpScan(the-ScanTypeparameter is also required)Start-MpWDOScan(runs before the OS loads; requires a restart; more info)Get-MpThreatUpdate-MpSignature
The two scanning cmdlets can also be run as jobs by passing the -AsJob switch.