How to use Windows Defender to scan a folder or file or your entire system for malware. – wintips.org

If you want to learn how to use Windows Defender to scan a specific file/folder or your entire system for malware, continue reading below.

Windows Defender (or “Windows Security”) is a built-in security program in Windows 10 that provides real-time protection against viruses, malware, and network attacks. In my opinion, Windows Defender is one of the best and most reliable free security software because it offers all the tools you need to protect your Windows system, including: Virus and threat protection, firewall and network protection, application and browser control, etc.

To keep Windows 10 safe and secure, it is recommended to periodically run a full scan of your system for viruses and always perform a special scan of files from storage devices or other sources. (For example, if you inserted a USB drive belonging to another user, or if you downloaded a file from the Internet or received it via e-mail.)

In this guide, we have shown different ways to scan your system or a specific file/folder for malware using Windows Defender Antivirus.

How to scan files or folders for viruses with Windows 10 antivirus.

Method 1. Run Microsoft Defender Scan from the right-click menu.
Method 2. Run a custom or full virus scan with Defender.
Method 3. Scan for viruses from the command line.
Method 3. Scan for viruses from PowerShell.

Method 1. How to scan a specific folder or file using the right-click menu.

The easiest way to scan a specific item (file, folder, disk) with Windows Defender is to use the right-click menu:

1. Right click on the item you want to check for threats.
2. Choose Scan with Microsoft Defender from the context menu.

How to scan a folder file with Defender

3. You will see the Windows Security window open and the selected folder or file will be scanned for malware.

How to use Windows Defender to scan a folder or file

4. When the scan is complete:

a. If any threat is found, click on it Start the action button and allow the system to perform the necessary actions and remove them.

defender actions

b. If no threats are found, the scanned item is clean and no further action is required.

clip_image004_thumb[1]

Method 2. How to perform a CUSTOM Scan with Windows Defender security software.

Another way to scan a folder, file or external USB drive is to use the “Custom scan” option in Windows 10 Security:

1. open the Running button and click the command window Win clip_image001 and R keys at the same time.
2. Enter the following and click Enter:

image_thumb[2]

3. click on Protection from viruses and threats and open it Scan settings.
4.
Choose Custom Scan* and press Scan now. *

*Note: Select to scan your entire system for malware Full scan option and then click Scan now.

Defender Custom and Full Scan

5. In the Select Folder window, select the folder/file or drive you want to scan for threats and click on it. Select a folder button.

clip_image011_thumb[1]

Method 3: How to check for viruses with Defender using the command line

To scan your system from the command line with Windows 10 Defender Antivirus:

1. It’s open Command line as administrator. For this:

Open 1 Run command window by holding the keys Win clip_image005[1]_thumb[2] + R at the same time.
2. Stand up cmd Press the & buttons Ctrl+Shift+Enter. *

*Note: At the “User Access Control (UAC)” permission prompt, click on it Yes.

clip_image014_thumb

2. In the Command Prompt window, execute the following commands in order (click Enter After entering each command).

  • cd c:\ProgramData\Microsoft\Windows Defender\Platform\
  • dir

Defender Command

3. From the folders in the list, find the name of the most recently created folder, which indicates the latest platform version of Defender. *

*Note: The folder names indicate which versions of Windows Defender Platform are installed on the system. The most recently created folder is the latest platform version of Windows Defender.

4. Now type the following command and click Enter:*

  • cd Latest platform version

*Note: In this example, the latest platform version is “4.18.2108.7-0”, so the command would be:

command line virus scan

5. To scan a specific folder or file, issue the following command: *

  • mpcmdrun -Scan -ScanType 3 -File “

Example: if you want to scan a folder named “”.sample” Located on the desktop (C:\Users\admin\Desktop\Sample), the command used is:

  • mpcmdrun -Scan -ScanType 3 -File “C:\Users\admin\Desktop\Sample”

defender scan command line

* Notes.

1. To run a Quick Check issue the following command for viruses from the command line:

  • MpCmdRun.exe -Scan -ScanType 1

2. To implement a Full scan for viruses issue the following command:

  • MpCmdRun.exe -Scan -ScanType 2

Method 4: How to Scan for Viruses from PowerShell Using Windows Defender

To scan your system for PowerShell threats:

1. It’s open PowerShell as administrator. For this:

Open 1 Run command window by holding the keys Win clip_image005[1]_thumb[2] + R at the same time.
2. Stand up powershell Press the & button Ctrl+Shift+Enter keys. *

*Note: At the “User Access Control (UAC)” permission prompt, click on it Yes.

image

2. From PowerShell, issue the following command to scan a specific folder/file for viruses: *

  • Start-MpScan -ScanType CustomScan -ScanPath

Example: if you want to scan a folder named “”.sample” Located on the desktop (C:\Users\admin\Desktop\Sample), the command would be::

  • Start-MpScan -ScanType CustomScan -ScanPath “C:\Users\admin\Desktop\Sample”

defender powershell command

*Notes:

1. To whom Quick Check Issue this command from PowerShell to your computer

  • Start-MpScan -ScanType QuickScan

2. To run a Full scan Issue the following command from PowerShell:

  • Start-MpScan -ScanType FullScan

defender full scan powershell

That’s it! Which method worked for you?
Let me know if this guide helped you by leaving a comment about your experience. Please like and share this guide to help others.

If you found this article useful, please support us by donating. Even $1 can make a big difference for us We continue to help others while keeping this site free:

Leave a Comment