Microsoft Defender Antivirus manual scanSource: 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.

VPN Deals: Lifetime license for $16, monthly plans at $1 & more

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.

    Microsoft Defender Antivirus manual scanSource: 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-0

    In the command, replace "4.18.2009.7-0" with the latest version of the folder available on your device.

    mpcmdrun locationSource: Windows Central

  6. 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"

    Microsoft Defender scan folder with Command PromptSource: Windows Central

    Quick note: You only need to use quotation marks if the path contains a space.

  7. 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"

    Microsoft Defender scan file with Command PromptSource: 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"

    Microsoft Defender Antivirus scan a folder with PowerShellSource: Windows Central

  4. 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"

    Microsoft Defender Antivirus scan a file with PowerShellSource: 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.

More Windows 10 resources

For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources: