Scanning file(s) by Windows Defender in command line

Miro Karkuš 1 Reputation point


I want to scan files/folders by Windows Defender in command line.
I copied whole help from command line to text file and tried it, but it scans anything other and I don't know what really.
I used command:

"C:\Program Files\Windows Defender\MpCmdRun.exe" -Scan -3 -File %path%

Where I'm not sure about scan argument - if is req'd to use the word "scan", and if, don't know if is req'd dash before scan type (normally it is not separate argument).
Also argument -File looks like not working.

Can anybody help me to fix it? And for to be sure add argument to see result to avoid else one mistake?

Thank you in advance.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
27,141 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Leon Laude 85,226 Reputation points


    You can use the Start-MpScan PowerShell cmdlet to manually scan files with Windows Defender.
    Then select what type of scan you want by defining the -ScanType switch.

    Start-MpScan -ScanPath %path% -ScanType {QuickScan | FullScan | CustomScan}  

    Best regards,

  2. Roy Li - MSFT 29,356 Reputation points Microsoft Vendor


    Welcome to Microsoft Q&A!

    Does @Leon Laude 's answer help to solve your issue? If not, you could ask about this issue in Windows 10 General Forum. It's a better place for asking questions like yours about windows 10.

    Thank you!

    0 comments No comments