How to use Windows Defender from Command Prompt to execute various tasks? Well, this post of MiniTool would tell you how to do that in detail.

What Can Windows Defender Do

Windows Defender is also referred to as Windows Security, which is an embedded utility in Windows systems. It usually runs silently in the background and offers you real-time protection. What does it do? It scans, detects, and removes viruses, spyware, and malware.

As shown in the picture below, Windows Defender can provide you with virus & threat protection, account protection, Firewall & network protection, app & browser control, and device (performance & health) protection.

features of Windows Security

If you are locked out of its graphics user interface or don’t want to launch it, you can directly use Windows Defender from Command Prompt.  This post shows you how to use Windows Defender from Command Prompt to execute different operations.

Before starting any operations, run Command Prompt as administrator. Here are the detailed steps for doing that.

Step 1: Type cmd in the search box.

Step 2: Click Run as administrator in the right panel. Alternatively, you can also right-click on Command Prompt and click Run as administrator.

run Command Prompt as administrator

Is Windows Defender Enough? More Solutions to Protect PC

Use Command Lines to Perform a Quick Scan

To find viruses, malware, and other threats in some common places, you can run a quick scan. As its name implies, the quick scan process will complete in a few minutes. If you want to use Windows Defender from Command Prompt to perform a quick scan, type the command below after running Command Prompt as administrator and hit Enter.

Tip: According to your configuration, you can replace 1 with 0 in the command to begin a default scan.

"%ProgramFiles%\Windows Defender\MpCmdRun.exe" -Scan -ScanType 1

perform a quick scan

Use Command Lines to Perform a Full Scan

If you would like to conduct an in-depth scan on your PC, you need to perform a full scan. Compared with quick the quick scan, a full scan needs more time. To execute a full scan via command lines, type the following command in the opened prompt window and press Enter.

"%ProgramFiles%\Windows Defender\MpCmdRun.exe" -Scan -ScanType 2

perform a full scan

How to Remove Mechanical, Membrane, and MacBook Keyboard Keys

Use Command Lines to Perform a Custom Scan

To scan specific files or folders for viruses and other threats, you should perform a custom scan. This sort of scan is also available for external storage devices like USB flash drives and external hard drives. The following command shows you how to use Microsoft Defender Antivirus from Command Prompt to conduct a custom scan.

Tip: You should replace D:\Folder\Path with the actual folder or file path that you would like to scan.

"%ProgramFiles%\Windows Defender\MpCmdRun.exe" -Scan -ScanType 3 -File "D:\Folder\Path"

Use Command Lines to Scan for Infected Boot Sectors

Boot sectors in the computer store all the important information related to your PC’s boot-up. However, some viruses and threats may attack the boot sector. Fortunately, you run Windows Defender from command line to scan and remove threats with boot sectors.

"%ProgramFiles%\Windows Defender\MpCmdRun.exe" -Scan -ScanType -BootSectorScan

scan boot sectors

WWE 2K22 Image Upload: Use the Image Uploader or Face Scan

Run Command Lines to Update Windows Defender Antivirus

You can also use Windows Defender from Command Prompt to update Microsoft Defender Antivirus. For that, you simply need to type the command below and press Enter.

"%ProgramFiles%\Windows Defender\MpCmdRun.exe" -SignatureUpdate

Run Commands Lines to Restore Quarantined Files

Files would be moved to Quarantine if Microsoft Defender Antivirus thinks it’s suspicious. If you need these files, you can restore them via the command lines of Windows Defender.

"%ProgramFiles%\Windows Defender\MpCmdRun.exe" -Restore -ListAll

Find the file that you want to restore from the list, and then type the command below and press Enter. You should replace FileName with the exact file name you want to restore.

"%ProgramFiles%\Windows Defender\MpCmdRun.exe" -Restore -Name "FileName"

How to run Windows Defender from command line? How to use Microsoft Defender Antivirus from Command Prompt? This post has shown you the answers. Read it now!

  • Linkedin
  • Reddit