How to scan a file manually with Microsoft Defender Antivirus on Windows 10

Microsoft Defender Antivirus manual scan
Microsoft Defender Antivirus manual scan (Image credit: Windows Central)

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 using File Explorer

To perform a manual scan for a specific file or folder with Microsoft Defender, use these steps:

  1. 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.
  2. Browse to the location containing the files and folder you want to scan.
  3. 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.
  4. Right-click the selection and select the Scan with Microsoft Defender option.

Source: Windows Central (Image credit: Source: Windows Central)

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.

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:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to access the Platform folder and press Enter:cd c:\ProgramData\Microsoft\Windows Defender\Platform
  4. Type the following command to identify the latest version of the antivirus command tool and press Enter:dir
  5. Type the following command to access the folder with the latest version and press Enter:cd 4.18.2009.7-0In the command, replace "4.18.2009.7-0" with the latest version of the folder available on your device.

Source: Windows Central (Image credit: Source: Windows Central)
  1. 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.

Source: Windows Central (Image credit: Source: Windows Central)
  1. 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"

Source: Windows Central (Image credit: Source: Windows Central)

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:

  1. Open Start.
  2. Search for PowerShell, right-click the top result, and select the Run as administrator option.
  3. 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"

Source: Windows Central (Image credit: Source: Windows Central)
  1. 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.TXTIn 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"

Source: Windows Central (Image credit: Source: Windows Central)

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

Mauro Huculak is technical writer for WindowsCentral.com. His primary focus is to write comprehensive how-tos to help users get the most out of Windows 10 and its many related technologies. He has an IT background with professional certifications from Microsoft, Cisco, and CompTIA, and he's a recognized member of the Microsoft MVP community.