These commands will keep your PC from viruses

Security is a crucial concern for most users, whether working locally on their PC or connected to the internet. In today’s world, attacks from various sources can strike at any time, but we have antiviruses to safeguard us.

One of the built-in and pre-installed security solutions offered by the Microsoft operating system is Windows Defender antivirus, which has convinced an increasing number of users to protect their computers and data. Over time, this security solution has grown exponentially, making it one of the most important in the world. Among its many features, it provides a real-time protection system.

commands antivirus

All of this helps to safeguard the PC against viruses, ransomware, spyware, and all sorts of malware. Additionally, we can use the Windows Defender antivirus from the Settings application, which we use for several tasks related to Windows customization. From here, we manage and control various functions and modes of behavior in addition to updates and analyses.

However, on some occasions, especially for advanced Windows users, basic tasks may need to be performed using Windows Defender commands. For example, this will be helpful if you want to create your script to automate some of the security software’s tasks. So, we’ll now show you some magical commands to protect your PC. To do this, open a command prompt or CMD window and use the commands we’ll demonstrate below.

The best commands for Windows antivirus

To begin, simply type “CMD” in the search box located on the Windows taskbar, and then launch the command prompt window with administrator privileges.

cmd admin

  • To ensure optimal protection, it is crucial to regularly update Windows Defender. Using an outdated antivirus is generally ineffective and significantly reduces the program’s protective capabilities. Therefore, to keep our system safe, we must use the following command to update Windows Defender:

cd C:/ProgramData/Microsoft/Windows Defender/Platform/4.18* MpCmdRun -SignatureUpdate

  • Performing a quick scan in Microsoft Defender is a common process for most users. To initiate this scan using Microsoft’s security solution, simply open a command prompt window and enter the following command. It is worth noting that instead of using the value 1, you can use 0 to perform the default type of analysis configured in the antivirus at that time.

cd C:/ProgramData/Microsoft/Windows Defender/Platform/4.18* MpCmdRun -Scan -ScanType 1

  • Scanning the PC’s boot sector is crucial as malicious codes can be installed directly in it. You can analyze this component using the Windows antivirus command line. To do this, follow the below command:

cd C:/ProgramData/Microsoft/Windows Defender/Platform/4.18* MpCmdRun -Scan -ScanType -BootSectorScan

It is important to note that these commands provide us with the opportunity to create customized scripts or batch files and automate the tasks mentioned to enhance PC security.