Windows 10: Scanning for viruses with Windows Defender by command line

  1.    3 Weeks Ago #1

    Scanning for viruses with Windows Defender by command line


    Hi!

    I know that Windows Defender allows to scan for viruses by command line.
    I'm using it not for simple problem - after scan (?) it closes console and I see result not.
    I'm using this command:

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

    How to leave console opened with visible result?

    Thank you for help.
    Miro
      My ComputerSystem Spec


  2. Posts : 617
    Microsoft Windows 10 Pro 64-bit
       3 Weeks Ago #2

    Open the command prompt and paste the command in it should stay open, If you start it with the run command it will close.

    To paste the command into the terminal:

    Open the command prompt with admin rights

    copy the command to the clipboard

    Paste the command with the right click of the mouse

    EDIT:
    Your command does not work

    Code:
    C:\WINDOWS\system32>"C:\Program Files\Windows Defender\MpCmdRun.exe" -Scan -ScanType 3 -File "%1"
    CmdTool: Failed with hr = 0x80070002. Check C:\Users\Owner\AppData\Local\Temp\MpCmdRun.log for more information
    Note:
    If you press the left mouse key in the terminal you will erase the clipboard contents.
      My ComputerSystem Spec

  3.    3 Weeks Ago #3

    So, this way it works not? I'm admin and owner of Program Files and Program Files (x86) folders - for problems I changed ownership.

    But you're talking about using it manually.

    I'm using it in menu of XYplorer and context menu (context menu of XYplorer allows to use only 32-bit menu and there is not included WD scan).
    XYplorer is perfect File Explorer replacement but new version has problem with 64-bit contexxt menu...

    Miro
      My ComputerSystem Spec


  4. Posts : 617
    Microsoft Windows 10 Pro 64-bit
       3 Weeks Ago #4

    Try this tutorial written by Brink from TenForums and see if it helps.

    How to Scan with Windows Defender in Windows 10 Windows 10 Tutorials
      My ComputerSystem Spec

  5.    3 Weeks Ago #5

    Thank you, so I do update and will see.

    Miro
      My ComputerSystem Spec


 

Related Threads
Defender Periodic Scanning or Offline Scanning? in AntiVirus, Firewalls and System Security
I use Kaspersky antivirus plus periodic scanning by Defender to benefit from US & Russian security technologies. I spotted there is a Defender option for offline scanning. Is there any advantage in using this compared to the periodic scanning...
i want start a Run a scheduled task via command line like this: Code: %SystemRoot%\system32\taskschd.msc /Run /TN "RegIdleBackup" when i run the cmd in the prompt as admin the shedular task GUI pop up but the task not start. Is there a...
If I use the power icon and thenclick sleep my backup software will wake up my computer and backup run myschedule. If I use any of the followingcommand lines, the software cannot wake my computer, I have ran “powercfg/h /off” at C:\windows\system32...
How to get more from Windows Defender by using its command-line tool - TechRepublic
Solved Computer Hangs while Scanning viruses using SpyHunter!! in AntiVirus, Firewalls and System Security
Hi guys I'm using Enigma spy Hunter. My dad has a huge data of books with all kinds of viruses and he used his HD on my laptop and now I'm in big trouble :3 I tried to fix this using hitman Pro and Spy hunter which I used to get the annoying...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:48.
Find Us