Technology
How to Scan for Viruses Using the Command Prompt (Cmd)
How to Scan for Viruses Using the Command Prompt (Cmd)
Have you ever needed to perform a virus scan using the Command Prompt (cmd) in Windows? Utilizing the built-in Windows Defender command-line tool, MpCmdRun.exe, can help you identify and remove threats effectively. Follow this guide to learn how to perform a quick scan, a full system scan, and a custom scan using cmd.
Steps to Scan for Viruses Using CMD
1. Open Command Prompt as Administrator
Press Windows R to open the Run dialog box.
Type cmd and press Ctrl Shift Enter to open Command Prompt as Administrator.
Alternatively, you can search for Run the Virus Scan using Windows search and run it as an administrator.
2. Perform a Quick Scan
To perform a quick scan, type the following command and press Enter:
mpcmdrun.exe / QuickScan
3. Perform a Full System Scan
To perform a full system scan, use the following command and press Enter:
mpcmdrun.exe / Scan /Full
4. Perform a Custom Scan
To perform a custom scan, specify a directory using the following command and press Enter:
mpcmdrun.exe / Scan /Path:"C:PathToDirectory"
Wait for the Scan to Complete
The scan will start and you will see the progress in the Command Prompt window. Depending on your system and the size of the files being scanned, this may take some time.
Review the Results
Once the scan is complete, the results will be displayed in the Command Prompt window. It will inform you if any threats were found and what actions were taken.
Additional Commands
To Update Windows Defender:
mpcmdrun.exe / Update
To Check the Status of Windows Defender:
mpcmdrun.exe / Status
Note
Make sure that Windows Defender is enabled and that you are running a supported version of Windows. If you are using a different antivirus software, you may need to refer to that software’s documentation for command-line scanning options.
Using Other Antivirus Tools
Depending on which antivirus software you have installed, you can run specific commands from the command line. Here are some examples:
1. Microsoft Malicious Software Removal Tool
Launch it from the elevated command prompt as:
mrt /Q /F:Y
For more information, launch it as:
mrt /
2. Kaspersky AV
Depending on the version of Kaspersky AV you have, you can use either avp or kavshell. For more info on command line switches, see:
Command line options for managing Kaspersky Anti-Virus 8.0 for Windows Servers Enterprise Edition Parameters of the command prompt in Kaspersky Anti-Virus 20103. McAfee Command Line Scanner
Use the scan.exe command with the following options:
scan.exe /adl /all /analyze /clean /program /unzip /winmem /rptall /reportc:scan.log
For more information, see:
How to perform a VirusScan Command Line scan in Microsoft Windows KB511414. AVG Command Line Scan
Use avgscanx for a 32-bit version of Windows or avgscanx 64 bit. Use /HELP to see all command line options. For more information, see: