How to Run Windows Defender from Command Line

Updated May 2024: Stop getting error messages and slow down your system with our optimization tool. Get it now at this link
  1. Download and install the repair tool here.
  2. Let it scan your computer.
  3. The tool will then repair your computer.

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”.

May 2024 Update:

You can now prevent PC problems by using this tool, such as protecting you against file loss and malware. Additionally, it is a great way to optimize your computer for maximum performance. The program fixes common errors that might occur on Windows systems with ease - no need for hours of troubleshooting when you have the perfect solution at your fingertips:

  • Step 1 : Download PC Repair & Optimizer Tool (Windows 10, 8, 7, XP, Vista – Microsoft Gold Certified).
  • Step 2 : Click “Start Scan” to find Windows registry issues that could be causing PC problems.
  • Step 3 : Click “Repair All” to fix all issues.

Download Now

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.

Expert Tip: This repair tool scans the repositories and replaces corrupt or missing files if none of these methods have worked. It works well in most cases where the problem is due to system corruption. This tool will also optimize your system to maximize performance. It can be downloaded by Clicking Here

Scroll to Top