Windows Security

Run Windows Defender Scan via Command Prompt on Windows 11

Scan your PC with Windows Defender Using Command Line

Windows Defender Scan via Command Prompt: It is an Integrated Advanced Security Feature from the Microsoft that protects our Windows 11 from various potential threats. There are different ways to access Windows Defender on Windows 11 such as via the Control Panel, via the Windows Settings, etc. However, it is possible to run Windows Defender Scan via Command Line using Command Prompt. In this article we will check out How to use Command Prompt and Windows PowerShell and run various Windows Defender Scans on Windows 11.

Related: 6+ Ways To Run Windows Defender As Administrator On Windows 11

Run Full Scan, Quick Scan, & Custom Windows Defender Scan via Command Prompt

Just like we run Full Scans, Quick Scans, and Custom Scans in the Windows Defender GUI Interface, we can also do the same via the Command Prompt. The following are the steps.

Run Windows Defender Full Scan using Command Prompt

  • Go to the Start menu and open Command Prompt. You can also use the Run Command (WinKey + R) to open Command Prompt(cmd).
Execute cmd in the Run Command
Execute cmd in the Run Command
  • In the Command Prompt, let’s navigate to the Windows Defender Directory using the following command. cd "%ProgramFiles%\Windows Defender"
Navigate to the Windows Defender Directory
Navigate to the Windows Defender Directory
  • This command will navigate to the Windows Defender Directory. Now, let’s perform the Scan using the following command. This will scan all files and drives on the system for potential threats. MpCmdRun.exe -Scan -ScanType 2
Windows Defender Full Scan CMD Command
Windows Defender Full Scan CMD Command
  • Once we execute the above command, the system will start its scan.
The Scan has Started
The Scan has Started
  • Since, it is a Full Scan, the process will take long time. As we are using MpCMDRun, we may not get real-time update.
  • Once the Full Scan is completed, Windows Defender will show the status of the scan via a Notification.

Run Windows Defender Quick Scan using the Command Prompt

In this section, we will check out how to run Windows Defender Quick Scan using the Command Line.

  • Go to the Command Prompt.
  • In the Command Prompt, let’s navigate to the Windows Defender Directory using the following command. cd "%ProgramFiles%\Windows Defender"
Navigate to the Windows Defender Directory
Navigate to the Windows Defender Directory
  • Now, Enter the Quick Scan CMD Command. This will scan critical system files, memory, and locations where threats are most likely to reside. The command as follows. MpCmdRun.exe -Scan -ScanType 1
Windows Defender Quick Scan Command
Windows Defender Quick Scan Command
  • The command will run Windows Defender Quick Scan. We won’t get realtime update. At the end of the scan, the system will update the status to Scan Finished.
Quick Scan Finished
Quick Scan Finished
  • Additionally, Windows Defender will notify us.

Note: If you want to log the scan results, then you can add -Log Flag to the above Commands. For Example, for running Quick Scan with Log File, execute the following command. MpCmdRun.exe -Scan -ScanType 1 -Log ScanLog.txt

Run Windows Defender Custom Scan using the Command Prompt

  • In the first step, let’s navigate to the Windows Defender Directory. cd "%ProgramFiles%\Windows Defender"
Navigate to the Windows Defender Directory
Navigate to the Windows Defender Directory
  • To run a Custom Scan, the following is the syntax. MpCmdRun.exe -Scan -ScanType 3 -File (path). Here replace the path with the Directory. For Example If we want to scan the Pictures Folder, then the commnd is MpCmdRun.exe -Scan -ScanType 3 -File C:\Users\vigne\Pictures
CMD Command to run Custom Scan
CMD Command to run Custom Scan
  • The system will scan the selected folder and will provide the status of the scan. Depending on the number of files, the Scan may take longer time to complete.
Scanning Found No Threats
Scanning Found No Threats

Run Offline Scan using the Command Prompt on Windows 11

An Offline Scan in Windows Defender refers to a specialized type of scan that runs outside the regular Windows environment. It is designed to detect and remove deeply embedded or advanced threats, such as rootkits or boot sector viruses, which might evade detection during regular scans because they load into memory along with the operating system. The following are the steps.

  • Open Command Prompt and Navigate to Windows Defender Directory using the following command. cd "%ProgramFiles%\Windows Defender"
  • Now, execute the Custom Scan Command. MpCmdRun.exe -Scan -ScanType 4
CMD Command to run Windows Defender Offline Scan
CMD Command to run Windows Defender Offline Scan

IMPORTANT: When you initiate an offline scan, the computer reboots into a secure, minimal environment created by Windows Defender.

Run Windows Defender Scheduled Scan using the Command Prompt

The command to run Scheduled Windows Defender Scan using the Command Line as follows.

Recommended: Smb 1.0 / Cifs File Sharing Support Using Command Prompt & Windows Powershell

  • Open Command Prompt and navigate to the Windows Defender Directory. Enter the following command and execute it. This command will run the Scheduled Scan configured in the Windows Defender Settings. MpCmdRun.exe -Scan -ScheduleJob
CMD Command to run Windows Defender Scheduled Scan
CMD Command to run Windows Defender Scheduled Scan

Update Virus Definitions using the Command Prompt

  • To ensure that the Virus Definitions are up to date, Kindly execute the following command. MpCmdRun.exe -SignatureUpdate
Command to Update Virus Definitions
Command to Update Virus Definitions
  • The system will check for the latest updates and update its Virus Database.
Signature Update Finished
Signature Update Finished

Different Types of Windows Defender Scans & their related Flags on Windows 11

Scan TypeFlagDescription
Quick Scan-Scan -ScanType 1Checks common threat locations.
Full Scan-Scan -ScanType 2Comprehensive scan of all files and drives.
Custom Scan-Scan -ScanType 3 -File <path>Scans a specific file or folder.
Offline Scan-Scan -ScanType 4Reboots to scan in a secure environment.
Scheduled Scan-Scan -ScheduleJobRuns at the next scheduled time.
Signature updation-SignatureUpdateUpdates Virus definitions

Take away

For everyday users, Running Windows Defender Scan via Command Prompt may seem like a complex task, these methods can be invaluable for power users, and administrators to take full control of their System Security. It can also be beneficial for users where Graphical User Interface is not available. If you have any queries, kindly let us know in the comment section. For more awesome articles, stay tuned to Winsides.com. Safe Computing! Peace out!

Related Articles:

Why You Can Trust Winsides.com?

We combine expert insights with user-friendly guidance. We thoroughly research and test everything to give you reliable and simple to understand tech guides. Please take a look at our publishing process to understand why you can trust Winsides.


Vigneshwaran Vijayakumar

Hello, I'm Vigneshwaran, the founder, owner, and author of WinSides.Com. With nearly a decade of experience in blogging across various domains and specializing in Windows-related tutorials for over five years, I bring a wealth of knowledge and expertise to WinSides.Com

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
Close

Adblock Detected

Kindly disable the Adblocker