Dealing with virus using command prompt (cmd)

Along with increase in usage of gadgets and internet, threat of virus is also increasing day by day. Activities of viruses like popups for no reason, blue screen errors or automatic restarting etc. will surely annoy you.If your pc is running slow,or strange windows keep popping up as you browse about windows,your pc may well have been infected by a virus.

Getting rid of virus

No doubt antivirus is the quickest way to heal your computer from virus but it costs hundread of bucks.Here,we will learn how to find the virus infected files and remove them from your pc.
If your computer allows virus to get in than it also has hidden power to kick them out and we are going to introduce you with those powers and show you how to remove virus without antivirus software.

“Prevention is better than cure”
Before talking about prevention, we should first know about how virus came in our computer or
laptop? Well answer of this question is quite simple, it can be when you are transferring files from your thumbdrive or portable harddisk. Another source of virus is by downloading email attachments or by downloading content via torrents. If we talk in general than USB and internet are the main source of virus. Now what to do to prevent your computer from virus getting in through       these mediums? 
  •   Disable autorun feature of USB disks.
  •  Another medium is internet but it is very difficult task to stop viruses getting in from internet yet not impossible. One of the easiest and most crucial thing which you should take care of is download things from only trusted sites or virus protected sites. One of the major threat of virus on internet is from torrent files so never ever download it.  
If you are using Google Chrome browser than you can download Webfilter Pro or any other similar chrome extensions.
How to identify virus??
Virus is not a physical thing it is a few lines of program which is meant to be code to complete any task. It is a virtual thing in your computer which is made by humans to complete any tasks.No need to worry... As every criminal leaves some clues behind, virus also lefts few clues after doing its work. As we are going to remove virus without antivirus software, you need to be very smart to identify virus infected files on your computer.

  1. One of the characteristic of virus is they have very unusual names and extensions like autorun.inf etc. so it is somehow easy to identify those type of files and also you can easily remove virus without antivirus.
  2. Mostly virus files are set as hidden in your folder so you should go into folder properties and     tick on show hidden files to see all hidden files in that folder.
  3. If you find any .exe file on clicking of which it do not run than it is also virus. Actually it do not runs in front of you but as soon as you click on it, it gets activated and it starts working in background.

Removing the virus

Now as you know your computer is infected,you can remove the virus. This will be done using command prompt.


  1. Click on windows icon and type cmd in the search box,then right click the cmd and open with administrator account. cmd window will open. 
  2.  Type cd/ and press enter. 
  3.  Then you have to check .inf and .exe files in the c drive. 
  4.  To find them,type attrib and press enter.This command shows files inside c drive. 
  5.  Now find if there is any s h r files in .inf and .exe extensions. 
  6.  Suppose you find a suspicious file “autorun.inf”. 
  7.  Type “attrib –h –s –r autorun.inf”. 
  8. Then type “del autorun.inf” to delete the suspicious files.
  9. Follow the same for other .inf and .exe files to delete them. 
  10. Now we will move to system32. 
  11. Type cd win* ,press enter and then type system32 and press enter. 
  12. Type “attrib” command and list of files will be displayed,Search for s h r files in .inf and .exe extensions. 
  13. Run this attrib command 3 or 4 times and make sure you have checked correctly. 
  14.  Delete all those files.


Dont be panic,if your pc is having virus,it can be destroyed also.Just make sure you follow the instructions carefully or else doing without perfect knowledge may harm your computer. 

This article is written by Urvashi Jindal, a techie from SRM University.