Command-line Switches to Automate Windows Defender GUI (MSASCui.exe)

Most users know that Windows Defender scans can be automated by using the console tool MpCmdRun.exe with Task Scheduler. But, did you know you can run a scheduled scan interactively (in GUI mode), that is without using Windows Defender’s console utility? This post lists some command-line switches to do that.

The Windows Defender executable MSASCui.exe supports the following switches, which you can set to run using Scheduler or by creating desktop shortcuts.

MSASCui.exe (GUI) Supported Switches

Update definitions and then run a Quick Scan

"C:\Program Files\Windows Defender\MSASCui.exe" -UpdateAndQuickScan

Run a Quick Scan

"C:\Program Files\Windows Defender\MSASCui.exe" -QuickScan

Run a Full Scan

"C:\Program Files\Windows Defender\MSASCui.exe" -FullScan

Update the Definitions

"C:\Program Files\Windows Defender\MSASCui.exe" -Update

All you need to do is create a task using Task Scheduler with the appropriate switch as above.

Run it hidden

If you want to run any of the above tasks minimized (in the notification area), add the "-hide" switch in addition.

windows defender command-line switches msascui gui

For example, the following command starts a Quick Scan, but without the Windows Defender program showing up on the screen. You can see the scan status or indicator in the Notification area.

"C:\Program Files\Windows Defender\MSASCui.exe" -QuickScan -hide

Using MpCmdRun.exe Command-Line Utility

Windows Defender console tool MpCmdRun’s basic command-line switches are given below:

Update definitions and then run a Quick Scan

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

The above one is again unofficial, and undocumented, which I blogged about earlier. Refer Using MpCmdRun.exe to Update Windows Defender and Run a Quick Scan in One Go.

Run a Quick Scan

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

Run a Full Scan

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

Update the Definitions

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

MpCmdRun.exe supports many additional switches (obviously) than its GUI counterpart. To see the complete list, open a Command Prompt window and type:

"C:\Program Files\Windows Defender\MpCmdRun.exe"

windows defender command-line switches

And, that’s it!

About the author

Ramesh Srinivasan founded back in 2005. He is passionate about Microsoft technologies and has a vast experience in the ITeS industry — delivering support for Microsoft's consumer products. He has been a Microsoft MVP [2003 to 2012] who contributes to various Windows support forums.

Leave a Comment