How To Remove Computer Virus Using CMD

How To Remove Computer Virus Using CMD

Virus is a type of malicious software program (“malware”), when executed, replicates by reproducing itself and infects other computer programs by modifying them. Virus can be transferred from one system to another. Some of the viruses are remain undetected even by your Antivirus and  to deal with it, you have to use another method.

Here, we have discussed how you can get rid of virus on your own. You can detect and remove computer virus using CMD(Command Prompt) and safe the important data on your system as well.

Command Prompt is a command line interpreter application available in most Windows OS. Command Prompt is used to execute entered commands.

Before using Command Prompt, let us know some basic commands about the same.

See Also: How to Remove Virus from Pen Drives

Attrib – The command allows a user to change the attributes of a file or files. With attrib, you can change, add or remove any of the attributes. These are the different attributes used now and then

  • ‘+ / –’: To enact or to cancel the specified attribute.
  • ‘/S’: Searching throughout the entire path including subfolders.
  • ‘/D’: Include any process folder.
  • ‘pathname’: Path where the target file or folder is located.

Steps To Remove Computer Virus Using CMD

Now follow these steps to know if your system is infected:

Step 1

Open Command Prompt with Administrator rights. Click on Start Button and type Command Prompt or CMD, make a right click on it and select the option ‘ Run As Administrator’.

run as admin

Step -2

Now you need to enter the drive, which you suspect is infected. Let us say, it is D drive on which you suspect. Use this command “D:”

cmd open

Step 3

Now you can see C will change to D. Type dir D: and hit enter. Following this command, will show you the directory of D drive.

remove virus cmd open

See Also: How To Protect Your Computer From Malware

Step 4

 Type “dir D: attrib -s -h /s /d *.*” and hit enter. This command to search through all the hidden and system files on the drive.

This command will search through the selected drive and load all the files including hidden and system files on that drive.

pen drive virus remove

 Step 5

In this window, you can check for unusual files with .exe extension if your system is infected. Let’s say you have a autorun.inf virus. Before deleting the file, you need to rename the file by using this command – rename filename.extension new filename.

 rename autorun

In this way, you can identify virus on your system or USB and delete them without using Antivirus program. Now that, you have renamed the file, you can delete the autorun.inf by typing in the command “del autorun.inf” or del :”yourfilename”

See Also: Devastating Computer Viruses That Could Rival Stuxnet

These are the simple steps to remove virus from your Flash Drive or your computer. You may also notice a speed enhancement on your system.  Try them and let us know if it worked for you.

Srishti Sisodia is a technical content journalist at Systweak Software. Apart from being a capable engineer, her affinity for inscription draws her towards writing interesting content about contemporary technologies and progressions. She is an avid reader and a fare connoisseur. She relishes different cuisines and when it comes to baking, she takes the cake!

Show your support

Clapping shows how much you appreciated Srishti Sisodia story.

2 thoughts on “How To Remove Computer Virus Using CMD”

    bagada sagar December 23, 2017 at 11:56 am thnx for the info. shrishti
    hariprakash.s October 17, 2018 at 1:59 pm this is very usefull for me

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.