How to Cancel an Ongoing Defender Scan started with Start-MpScan

The PowerShell cmdlet Start-MpScan starts a Microsoft Defender antivirus scan, but PowerShell offers no option to stop an ongoing scan. You may wonder how to cancel an ongoing quick/full scan started with Start-MpScan.

Unfortunately, when you start a scan using PowerShell, the Windows Security dashboard doesn’t indicate whether a scan is in progress, and offers no option to cancel a scan.

Also, when you press Ctrl + C in an attempt to cancel the scan, only the notification is removed. But the ongoing scan doesn’t stop.

start-mpscan

Resolution

To stop an ongoing scan initiated by the Start-MpScan PowerShell command, use the MpCmdRun.exe console tool.

Open an admin Command Prompt window.

(Note: The following command may not work in PowerShell. Please run it from admin Command Prompt only.)

Run the following command:



"C:\Program Files\Windows Defender\MpCmdRun.exe" -Scan -Cancel

or

"C:\Program Files\Windows Defender\MpCmdRun.exe" -Scan -ScanType -Cancel

You should see the following output:

Argument -cancel detected. Trying to cancel any quick/full scan in progress...
Scan cancelled successfully.

If no scans are ongoing, the command outputs the following message instead:

Argument -cancel detected. Trying to cancel any quick/full scan in progress...
No on-going quick or full scan found.

The above method works irrespective of the method used to start the scan — e.g., via PowerShell, Windows Security dashboard, or the MpCmdRun.exe console tool.

I hope that information helps.


One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time.

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a ten-time recipient of the Microsoft MVP award in Windows Desktop Experience (Windows Shell), from 2003 to 2012. Ramesh founded Winhelponline.com in 2005.

Leave a Comment