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
).
- In the Command Prompt, let’s navigate to the Windows Defender Directory using the following command.
cd "%ProgramFiles%\Windows Defender"
- 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
- Once we execute the above command, the system will start its scan.
- 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"
- 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
- 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.
- 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"
- 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 isMpCmdRun.exe -Scan -ScanType 3 -File C:\Users\vigne\Pictures
- 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.
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
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
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
- The system will check for the latest updates and update its Virus Database.
Different Types of Windows Defender Scans & their related Flags on Windows 11
Scan Type | Flag | Description |
Quick Scan | -Scan -ScanType 1 | Checks common threat locations. |
Full Scan | -Scan -ScanType 2 | Comprehensive scan of all files and drives. |
Custom Scan | -Scan -ScanType 3 -File <path> | Scans a specific file or folder. |
Offline Scan | -Scan -ScanType 4 | Reboots to scan in a secure environment. |
Scheduled Scan | -Scan -ScheduleJob | Runs at the next scheduled time. |
Signature updation | -SignatureUpdate | Updates 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:
- How to Run System Properties as Administrator on Windows 11?
- 4+ Best Ways- Open Computer Management as Administrator on Windows 11!
- How to Run DiskPart as Administrator on Windows 11? 4 Easy Ways!
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.