Scanning file(s) by Windows Defender in command line

Miro Karkuš 1 Reputation point
2020-05-22T17:26:09.257+00:00

Hi!

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.
Miro

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

2 answers

Sort by: Most helpful
  1. Leon Laude 85,651 Reputation points
    2020-05-22T17:55:06.587+00:00

    Hi,

    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,
    Leon


  2. Roy Li - MSFT 31,766 Reputation points Microsoft Vendor
    2020-05-25T05:39:36.877+00:00

    Hello,

    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