Remove Virus Using CMD

How to Remove Virus Using CMD Windows 10?

Removing a virus from a Windows 10 computer using the Command Prompt (cmd) can be tricky. However, with the right tools and knowledge, it can effectively clean up your system. To remove the virus, enter safe mode, run a full system scan, and use the command prompt afterward. Next, use system restore and prevent future viruses. If you cannot remove the virus using CMD Windows 10 at home, it is better to get professional help. Therefore visit a mobile and computer repair shop to eliminate the virus efficiently. 

Methods to Remove Virus 

Enter Safe Mode

Before attempting to remove a virus from your computer, you should always start by entering Safe Mode. This is a mode in which Windows loads only the most basic drivers and services, making it easier to remove malware. To enter Safe Mode, follow these steps:

  • Press the Windows key + R to open the Run dialog box.
  • Type “msconfig” and press Enter.
  • In the System Configuration window, click on the Boot tab.
  • Under the Boot options section, check the “Safe boot” box.
  • Select the “Minimal” option, and click OK.
  • Restart your computer.
  • Once your computer restarts, it will boot into Safe Mode.

Note that the Command Prompt will be available in Safe Mode. You can also ask a professional at a phone repair store to help you with this process.

Run a Full System Scan

The first step in removing a virus is to run a full system scan using your antivirus software. Most antivirus programs have a built-in scan feature to detect and remove viruses from your computer. To run a full system scan, follow these steps:

  • Open your antivirus software.
  • Click on the Scan option.
  • Select the Full Scan option.
  • Click on Start Scan.
  • The scan may take some time to complete, depending on the size of your hard drive and the amount of data on it. Once the scan is complete, the antivirus software will tell you if any viruses were found. Or hire a computer repair professional for this task.

Use the Command Prompt to Remove the Virus

If your antivirus software cannot remove the virus, or if you don’t have antivirus software installed on your computer, you can use the Command Prompt to remove the virus. Here are the steps to follow:

  • Open the Command Prompt as an administrator. To do this, click on the Start menu, type “cmd” in the search box, right-click the Command Prompt app, and select “Run as administrator.”
  • Type the following command and press Enter: “netstat -ano” (without the quotes). This command will display a list of all the processes currently running on your computer, along with their associated port numbers and process IDs (PIDs).
  • Look for any suspicious processes or connections that you don’t recognize. You can identify suspicious processes by their name or PIDs. If you’re unsure whether a process is legitimate, you can search for it online to find out more information about it.
  • Once you’ve identified the suspicious process, type the following command and press Enter: “taskkill /F /PID [PID number]” (without the quotes). Replace “[PID number]” with the PID of the suspicious process you want to terminate. This command will force the process to stop running on your computer.
  • Type the following command and press Enter: “regedit” (without the quotes). This will open the Registry Editor.
  • Navigate to the following key: “HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run” (without the quotes). This key contains a list of all the programs set to run automatically when you start your computer.
  • Look for any suspicious programs in the list. If you find any, right-click on them and select Delete to remove them from the list.
  • Close the Registry Editor and restart your computer.
  • Once your computer has restarted, you should run another full system scan to ensure the virus has been completely removed.

Use System Restore

If the virus has caused significant damage to your system, you may need to use System Restore to restore your computer to a previous point before the virus was present. Here are the steps to follow:

  • Open the Control Panel by clicking the Start menu and selecting Control Panel.
  • Click on System and Security.
  • Click on System.
  • Click on System Protection.
  • Click on the System Restore button.
  • Follow the prompts to select a restore point and restore your system.

Note that this process will undo any changes made to your system after the selected restore point, so back up any important data before proceeding with this step. Or get help from the computer repair professional in this regard. 

Prevent Future Infections

Once you have removed the virus from your computer, it’s important to take steps to prevent future infections. Here are some tips to help you do this:

  • Install antivirus software and keep it up to date.
  • Keep your operating system and other software updated with the latest security patches.
  • Be cautious when opening email attachments or downloading files from the internet.
  • Use strong passwords and enable two-factor authentication whenever possible.
  • Backup your important data regularly.


Removing a virus from your Windows 10 computer using the Command Prompt can be complex, but it can be effective if done correctly. Start by entering Safe Mode and running a full system scan with your antivirus software. If the virus is not detected or removed, you can use the Command Prompt to terminate suspicious processes and manually remove any associated registry entries. If the virus has caused significant damage to your system, you may need to use System Restore to undo the damage. Finally, take steps to prevent future infections by using antivirus software, keeping your operating system up to date, being cautious online, using strong passwords, and backing up your data regularly. Get professional help from the best computer repair shop like Gadget Bros if you cannot get rid of the virus.