RECOMMENDED: Click here to fix Windows errors and optimize system performance
You can use the Windows Defender command line utility to automate basic tasks and perform some advanced operations. Here is an overview of how to use the tool and examples of its usefulness.
Commands to Run Windows Defender from Command Line
To run Windows Defender from a command line or command prompt, you must have administrator privileges. In addition, although there are many commands to cover, we will only see the most useful ones, i.e. signature updates, full scan, quick scan, custom scan, and boot sector scan.
First, open the command prompt as an administrator and run the following commands if necessary. To open the command prompt as an administrator, look for “cmd” in the Start menu, right-click the result and select “Run as administrator”.
Command to update Windows Defender signatures:
Before scanning the system, it is always a good idea to check and update Windows Defender signatures. This way Windows Defender will be scanned with the latest virus signatures.
To update Windows Defender signatures from the command prompt, use the following command.
"%ProgramFiles%\Windows Defender\MpCmdRun.exe" -SignatureUpdate
If signature updates are available, they are automatically downloaded and installed. Once this is done, you will see the message “Signature update complete”.
Quick scan command:
"%ProgramFiles%\Windows Defender\MpCmdRun.exe" -Scan -ScanType 1
Full scan control:
"%ProgramFiles%\Windows Defender\MpCmdRun.exe" -Scan -ScanType 2
Custom scan control:
"%ProgramFiles%\Windows Defender\MpCmdRun.exe" -Scan -ScanType 3 -File "C:\FileOrFolderPath"
Boot sector scan command:
"%ProgramFiles%\Windows Defender\MpCmdRun.exe" -Scan -ScanType -BootSectorScan
Finally, it is important to note that while we focus on Windows 10 in this guide, these instructions should also be compatible with earlier versions of the operating system, including Windows 7 and Windows 8.1.
That’s all I’m saying. As you can see, the command line options of Windows Defender are quite user-friendly and easy to use. If you’re interested, take a look at this Microsoft Docs page for other commands that allow you to list, add or remove dynamic signatures, check execution paths, track diagnostics, and much more.
Comment below on your thoughts and experiences using Windows Defender from the command line.
RECOMMENDED: Click here to troubleshoot Windows errors and optimize system performance
CCNA, Web Developer, PC Troubleshooter
I am a computer enthusiast and a practicing IT Professional. I have years of experience behind me in computer programming, hardware troubleshooting and repair. I specialise in Web Development and Database Design. I also have a CCNA certification for Network Design and Troubleshooting.