Thursday, 10 July 2014

How to Find & Remove Viruses in Windows using Command Prompt

Hello friend messing up with some virus? Though your antivirus software removes virus and problem persists, searching google for the removal and you are into a perfect site for a solution. Virus is a computer program that can copy itself and infect your computer. These viruses can spread via USB/flash drive or from one computer to other computer by few written codes.

There are many antivirus software available to remove viruses from computer. But there are some viruses or suspicious files which can’t be removed by any antivirus software. Some suspicious files such as autorun.inf initiate all the viruses in pc.

Remove virus using CMD

These files must be removed for safe operation of your pc, because they may lead to data loss, software damages etc.Here's a trick to remove all your viruses. Follow the steps given below to remove viruses using cmd ( command prompt )

Finding & Removing Viruses Using Command Prompt

Follow the below guide only if you think any of your drive is affected with virus or if you think there are some harmful files and you want to delete them.

Step 1: Go to start menu and type “cmd” in the search box or Start>all programs>accessories>command prompt.

Step 2: Select the infected drive,to do so type in CMD , D: to go to D: drive.

Step 3: Now type dir/w/a . It will show all the files of the drive including hidden files.

Now Check if there is any file or virus that you are not aware of and you think might be Harmful to your PC.

Step 4: Usually there is Autorun.inf file which you must delete it. to do so Type in attrib -h -r -s autorun.inf  and press Enter. Type del autorun.inf  and press Enter. Follow this for all other drives.

Step 5: We have now Succesfully found and deleted autorun.inf file from D drive. if you find any .exe file which is unknown to you. then delete it using the same above method.

How to remove Shortcut virus using cmd ?

The Shortcut viruses are those which converts all your data from your pen drive or Hard disk to shortcuts, but they are recoverable. just follow the below given steps to remove shortcut virus from pen drive and recover back your files.

  • Go to Start -> Run -> cmd.
  • Go to your pen drive directory.
  • Type this command: del *.lnk and press Enter.
  • Type attrib -h -r -s /s /d e:\*.* And then press Enter.

Recover your files :

You can recover your files through Winrar.

  1.  Open WINRAR Application.
  2. Navigate to your Pendrive location or PC Folder location.
  3. Copy Files and Paste where you want.
  4. Format your Pendrive. 

Got some Files in your pen drive but they are empty! Because of the virus in your pendrive malfunctions your drive. How to remove this empty folder virus and recover files? Follow the steps given below.
  • Start -> Run -> cmd.
  • Type this command: attrib -h -r -s /s /d x:\*.* 
  • Here the letter "x" should be replaced with the drive alphabet of your pendrive that you have inserted into the computer.
  • If your pendrive shows the drive alphabet as "J", then type  this command: attrib -h -r -s /s /d j:\*.* And then press Enter.

Restart your Pc for the changes to take place... So these were some methods to find and remove different viruses using Command Prompt. I hope this will help many of my Readers.
If You Like This Post Please Mind to Share It.
Technorati Digg This Facebook Twitter Stumble Stumble


  1. Attrib-h-s-s...... these things it says it is not recignised.

    1. Hi Athot, You need to have space between them... please try again with space...


  2. yes viruses has been deleted but if i shutdown it again appears in laptop

    1. just download anti virus it will do everything. but be sure to download there right one.
      i use eset.(

  3. When I try to del Autorun.inf it shows THE SYSTEM CANNOT FIND THE FILE SPECIFIED and when I try to del it manually it shows THIS IS NO LONGER LOCATED IN X:\ VERIFY THE ITEM'S LOCATION AND TRY AGAIN . But still folder is there now what to do ? How to remove it :(

  4. del *.lnk this command is not recognized can you help me regarding this

    1. run cmd as administrator then type the same command

  5. superb, ran this no virus good to know this trick thanks

  6. thanks .... can u please explain password crack in win 8 .i used crack passwrd in win xp using win 98 cd i boot in to bios and use cmd to crack pswrd. can u explain for win 8