How to scan a file manually with Microsoft Defender Antivirus on Windows 10
Do you have a suspicious file? If so, you can scan it for malware manually using Microsoft Defender Antivirus on Windows 10 – here are three ways to complete the task.
Microsoft Defender Antivirus is the anti-malware application that comes integrated with every installation of Windows 10. Out of the box, it provides robust real-time protection against viruses, ransomware, spyware, and many other types of malware and hackers.
Although the antivirus is always monitoring and periodically scanning your files to detect and remove unwanted malware automatically, sometimes, you may still want to check a specific file or folder manually to make sure they do not contain any kind of viruses or malicious code that may harm your computer and files.
If you must scan a file or folder manually, Microsoft Defender includes at least three different scan methods using the File Explorer, Command Prompt, and even PowerShell.
In this Windows 10 guide, we'll walk you through the steps to scan a file or folder with Microsoft Defender Antivirus without the need for a full scan.
- How to scan a file or folder manually with Microsoft Defender
- How to scan a files or folder manually with Defender using Command Prompt
- How to scan a file or folder manually with Defender using PowerShell
How to scan a file or folder manually with Microsoft Defender using File Explorer
To perform a manual scan for a specific file or folder with Microsoft Defender, use these steps:
- Open File Explorer.Quick tip: You can open File Explorer using the Windows key + E keyboard shortcut, clicking the icon from the taskbar, or querying the app from the Start menu.
- Browse to the location containing the files and folder you want to scan.
- Select one or multiple items (as necessary).Quick tip: You can select all items using the Ctrl + A keyboard shortcut, pressing the Ctrl key and selecting the items you want to scan, or selecting the first item, pressing the Shift key, and selecting the last item you need to check.
- Right-click the selection and select the Scan with Microsoft Defender option.
As you complete the steps, the Windows Security app will open in the "Virus & threat protection" page, where you'll be able to see the scan progress, result, and require action if malware is detected.
You can also use the "Custom scan" option from the "Virus & threat protection" section to perform custom scans. However, you can only use it to scan folders, not a specific file, which is why we're not listing this option.
Get the Windows Central Newsletter
All the latest news, reviews, and guides for Windows and Xbox diehards.
How to scan a file or folder manually with Defender using Command Prompt
To scan a specific folder or file manually using Command Prompt, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to access the Platform folder and press Enter:
cd c:\ProgramData\Microsoft\Windows Defender\Platform
- Type the following command to identify the latest version of the antivirus command tool and press Enter:
dir
- Type the following command to access the folder with the latest version and press Enter:
cd 4.18.2009.7-0
In the command, replace "4.18.2009.7-0" with the latest version of the folder available on your device.
- Type the following command to scan a specific folder and press Enter:
mpcmdrun -Scan -ScanType 3 -File "C:\PATH\TO\FOLDER"
In the command, replace "C:\PATH\TO\FOLDER" with the path to the folder you want to scan.For example, this command scans all the contents in the "files" folder:mpcmdrun -Scan -ScanType 3 -File "C:\Users\username\Downloads\files"
Quick note: You only need to use quotation marks if the path contains a space.
- Type the following command to scan a specific file and press Enter:
mpcmdrun -Scan -ScanType 3 -File "C:\PATH\TO\FILE.TXT"
In the command, replace "C:\PATH\TO\FILE.TXT" with the path to the file you want to scan.For example, this command scans the file named "image-1.jpg" inside the "files" folder:mpcmdrun -Scan -ScanType 3 -File "C:\Users\username\Downloads\files\image-1.jpg"
Once you complete the steps, Microsoft Defender will scan the files, and if they're clean, you'll receive the "found no threats" message. Also, you can use this guide to manage many other aspects of the antivirus.
How to scan a file or folder manually with Defender using PowerShell
To scan a file or folder manually using PowerShell, use these steps:
- Open Start.
- Search for PowerShell, right-click the top result, and select the Run as administrator option.
- Type the following command to scan a folder using Microsoft Defender Antivirus scan and press Enter:
Start-MpScan -ScanType CustomScan -ScanPath "C:\PATH\TO\FOLDER"
In the command, make sure to replace "C:\PATH\TO\FOLDER" with the folder location you want to scan.For example, this command scans the "files" folder:Start-MpScan -ScanType CustomScan -ScanPath "C:\Users\username\Downloads\files"
- Type the following command to scan a file manually with Microsoft Defender and press Enter:
Start-MpScan -ScanType CustomScan -ScanPath C:\PATH\TO\FOLDER\FILE.TXT
In the command, make sure to replace "C:\PATH\TO\FOLDER\FILE.TXT" with the path to the file you want to scan.For example, this command scans the file called "image-1.jpg" for threats:Start-MpScan -ScanType CustomScan -ScanPath "C:\Users\username\Downloads\files\image-1.jpg"
After you complete the steps, Microsoft Defender Antivirus will only scan the file you specified for viruses in the location you selected.
In addition to scanning a specific file or folder, the Microsoft Defender Antivirus modules in PowerShell allow you to manage many other functionalities. You can check this comprehensive guide for more information.
Mauro Huculak has been a Windows How-To Expert contributor for WindowsCentral.com for nearly a decade and has over 15 years of experience writing comprehensive guides. He also has an IT background and has achieved different professional certifications from Microsoft, Cisco, VMware, and CompTIA. He has been recognized as a Microsoft MVP for many years.