Windows Defender’s command-line utility MpCmdrun.exe is used for scheduling scans or updating definition files or signature using command-line. This post tells you how to setup Windows Defender to scan the computer daily at a specified time using Task Scheduler and MpCmdrun.exe in Windows 10.
Note: Windows 8 and 10 already include the Automatic Maintenance feature which runs many scheduled tasks including Windows Defender daily scan, but the task runs only if the system is idle. Moreover, Automatic Maintenance stops running once it detects user activity in the system.
If you can leave the system idle for some time daily for Automatic Maintenance, you don’t have to schedule it manually. Creating a scheduled task manually surely runs the scan, regardless of whether your system is idle or not.
Method 1: Create Windows Defender Scan Task Using SchTasks.exe
To schedule a daily Windows Defender scan, create a scheduled task using
SchTasks.exe console tool using the following steps:
- Open a elevated Command Prompt. To do so, right-click Start and click Command Prompt (Admin).
- Type in the following command and press
schtasks /create /tn "Scan With Defender (Daily Quick Scan)" /sc DAILY /st 13:00 /ru SYSTEM /rl HIGHEST /tr "'C:\Program Files\Windows Defender\MpCmdRun.exe' -Scan -ScanType 1"
This creates a Windows Defender Scan task that runs daily, at
SYSTEMuser account with highest privileges. If you running it under
SYSTEMaccount you wouldn’t see the Command Prompt window that the task runs in. To see the Command Prompt window (interactive), change
SYSTEMto your user name (say,
John, in place of
EXITto close the Command Prompt window.
The above command was given as an example. You can alter the scan schedule time, frequency (DAILY, WEEKLY, MONTHLY) accordingly as per your requirements. For more information about Schtasks.exe command-line switches, see Schtasks.exe | Microsoft Docs article.
Method 2: Create Windows Defender Scan Task Using Task Scheduler
If you’d like to configure Windows Defender Scan schedule using Task Scheduler GUI, use these steps:
- Click Start, type Task Scheduler and click Task Scheduler from the list.
- From the Action menu, click Create Basic Task…
- Assign a name for the task, and give an apt description for the custom task.
- If you want to run the task once daily, click Daily, and click Next.
- Set the time when you want to task to run, and click Next.
- In the Action dialog, click Start a program, and click Next.
- In the Program/Script text box, mention the full path of
MpCmdRun.exe. In the Add arguments text box, type one of the following:
-Scan -ScanType 1 (for Quick Scan)
-Scan -ScanType 2 (for Full system Scan)
SignatureUpdateAndQuickScanparameter does two things just as the name implies; Updates the signatures and then runs a Quick Scan. It is a hidden parameter not mentioned in the help or anywhere, which works in Windows 8 and 10. I’ve recently unveiled this hidden and useful parameter; check out my earlier posts Using MpCmdRun.exe to Update Windows Defender and Run a Quick Scan in One Go and Command-line Switches to Automate Windows Defender GUI for more information.
- Select the Open the Properties dialog for this task when I click Finish, and click Finish.
- Enable the check box for
Run with highest privileges.
- Select Windows 10 in the Configure for: drop down list box.
- Exit the Task Scheduler.That’s it! You’ve now created a task that launches Windows Defender Scan on schedule. The task duly runs as mentioned, at the specified time. The Command Prompt window can simply be minimized.
If you used the
SignatureUpdateAndQuickScanparameter, it updates the signatures and follows up with a Quick Scan.
Hope the guide helped you learn the two methods which can be used to run Windows Defender Scheduled Scan on your Windows computer. Let’s know your comments.
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!