TechTipsApp

Technology tips blog

  • Articles
    Categories
    • Tech news
    • Internet
    • Social Network
    • Google
    • Geeky Tips
    • Android
    • Windows 10
    Top Posts
    • Install Windows XP from USB
    • Install Windows 7 from USB
    • Open Facebook When It's Blocked
    • Partition Hard Drive Without Formatting
    • Reset Windows 7 Password
    • About
    • Contact
    • Privacy policy
    • Advertise
    • Terms of Conduct & Copyright Policy

Remove Virus from Computer or USB Drive by Command Prompt

Tanmay Windows 48 Comments

The word  “Virus” is a threat to users of Windows. Users feel uneasy to connect others USB or pen drive to their Computer for the inflections made by Virus. Viruses spread in Computer to Computer through the pen drive or any removable disk drive. Mainly Autorun.inf or many .exe  files like newfolder.exe, ravmon.exe etc affect the documents of your computer. If you try to delete the file from the directory they come back automatically every time and it easily spreads in the computer.
Tip: Clean Your Computer Removing Antivirus Live Application.
These Autorun or .exe files are written in such a manner that when we try to open or rename a drive a specific program starts as a result we can’t do those works.You can remove viruses from Task Manager. You have to stop the affecting process from “Task Manager” by choosing that process as “End Task” in Task Manager. But the virus programmer are much aware about that so when you want to open “Task Manager” by pressing “Ctrl+alt+del” you will see that the “Task Manager has been disabled by your administrator“.
Also read: How to make a folder undeletable
In this situation there is another process to remove autorun.inf from Command Prompt. That seems more effective. You have go through some commands only. But the Command Prompt may be disabled by the virus. You can download a replacement of the Command Prompt.
However after getting the access of Command Prompt you can apply the following tricks to remove the virus from your computer.
Related: Remove Virus Manually From Your Computer.
First click the “Start” button and go to “Run“. You can also press “Windows+R“. Type “cmd” there.

Type the following commands in the Command Prompt

  • Type “<Drive_name>:” in the command prompt and hit “Enter“. (“Drive_name” is where the problem occurs, it may be any USB drive)
  • Type “attrib” and hit “Enter“. (This shows the files that are present in the currently working directory. You can also use the command “dir/w/o/a/p“)
  • If there are any file named autorun.inf then go for next steps else the drive is not affected with any autorun.inf file.
  • Type “attrib -h -r -s -a *.* ” then hit “Enter“.  (This command removes the Hidden, Read Only, System and Archive attributes over any file)
  • After unhiding and removing attributes you can see the files.  So you can delete the file now.
  • Type “del <filename>” in the Command Prompt and hit “Enter“. (As for example del autorun.inf)

Now your computer is virus free. Enjoy! Feel free to share your experience with us.

Post Tags: Command Prompt, USB Device, Virus
Similar Articles from This Blog
How to Fix Google Chrome Class Not Registered Error
How to Fix Google Chrome Class Not Registered Error
Extend Windows 7 and 8.1 Trial Period Up To One Year
Extend Windows 7 and 8.1 Trial Period Up To One Year
What to do If Your Lenovo Laptop has Superfish Adware
What to do If Your Lenovo Laptop has Superfish Adware
How To Fix Major USB Problems
How To Fix Major USB Problems
How to Speed Up USB Data Transfer Rate in Windows 7
How to Speed Up USB Data Transfer Rate in Windows 7
Poweliks A Windows Registry Malware Runs Without an Installer file
Poweliks A Windows Registry Malware Runs Without an Installer file

Comments

  1. Ajinkya :

    nice guide.
    Also, if your computer is infected with a RAT (Remote admin tool – that gives full access to the hacker… e.g. you see your mouse moving automatically. LOL )
    Do this >
    1. open CMD (Start > RUN > type: cmd )
    2. Type in: netstat – ano
    (it shows all ur network accessing process with their Process identification codes = PID )
    3. if you see a Text like this > ESTABLISHED with a foreign IP, note down its PID.
    It will also show the EXE accessing it.
    4. go to TASK MANAGER (CLTR + ALT + DEL)
    – then go to VIEW > Tick PID
    5. in the Proccess TAB > just click that PID process EXE file.
    6. now disconnect your internet & scan your whole Computer with SpyBot SD 1.6 & NOD32 v.4
    7. your are virus free now.
    NOTE: you will say why didnt i disconnected internet at Start !! thats cus teh RAT virus will also get exit, will come again whn u access the net & netstat needs internet connection ON to show PID.

    Reply
  2. Tanmay :

    @Ajinkya
    Very nice tips. Thanks for sharing.

    Reply
  3. Raj Kumar :

    Pen Drive Format Error write protect
    Pls give me Solution

    Reply
  4. Umesh.u :

    You have worm in a pendrive or system .get a antivirus which is updated.I Prefer avast

    Reply
  5. Shaun Phaladi :

    i want to know the code to cleaning my machine of any viruses and how to check them also mainly using command prompt.

    Reply
  6. mko abiola :

    tnks but a question would deleting those files result in lose of files?

    Reply
  7. mko abiola :

    sory pls are my going to include the quotes when writing the the command prompt bcos when i typed””, it said the command is incorrect.PLS

    Reply
  8. Tanmay :

    @Mko Abiola: NO..don’t include ” signes.

    Reply
  9. mko abiola :

    @tanmy pls when i typed drive_name it said the command is an incorrect command

    Reply
  10. Tanmay :

    type drive_name means that you type the drive letter. As for example you should type d: and hit enter.

    Reply
  11. Nirmal :

    plz solve my pen drive problem which shown ‘remove the write protection’, I am tired about my problem, I can’t use pen drive, what is solution ?
    Nirmal

    Reply
  12. kenneth :

    i learn a lot of things in this website….and i was thankful for that…

    Reply
  13. d.datta bhuloka rao :

    i have a 8gb pendrive that not formt that is having virus plese give me solution.

    Reply
  14. kankasha :

    guys, when inserting my flush in machine and try 2 open it, it said the drive is empty. cud u plz help.

    Reply
  15. Marko :

    good way, or try this one too 😉
    http://adf.ly/8DMh1
    http://adf.ly/8DLSY

    Reply
  16. ken :

    i don know how to thank you..All i can i say is,,keep up.easy to understand, i even wish you were my teacher.thanks alot.

    Reply
  17. Jenny :

    how do you know if it’s a virus or not?

    Reply
  18. albert :

    tanx…but i need help! My laptop is suffering from virus i dont know abt nd i can install an antivirus…plss i really need help.

    Reply
  19. Chase :

    This line of code only deletes what you chose it to, though, if you know where the virus is located (i.e. the directory (C: Drive for Windows) Press “Tab” to browse through the files on your local drive. This works:
    @ECHO OFF
    prompt $p$g
    title algeeroidbiletdoux System
    FlashX
    :Shredder
    color 02
    CLS
    ECHO.
    ECHO algeeroidbilletdoux System
    FlashX
    ECHO DRIVE SHREDDER
    ECHO.
    dir /a/w
    ECHO.
    ECHO “PRESS THE TAB KEY IN
    YOUR KEYBOARD TO SELECT ON
    THE DIRECTORY”
    ECHO.
    SET /P M= SHREDD
    IF NOT EXIST %M% GOTO
    :driveShredderERROR
    attrib -s -h -r %M%
    del /f /q %M%
    IF NOT EXIST %M% GOTO
    :SHREDCOMP
    RD /S %M%
    :SHREDCOMP
    COLOR 0A
    echo MyBox = MsgBox(“File/Folder
    has been Shredded. File/Folder has
    been removed…”, 6000,
    “algeeroidbilletdoux System
    FlashX”) >driveshredder.vbs
    start /w driveshredder.vbs
    del /f /q driveshredder.vbs
    GOTO :Shredder
    :driveShredderERROR
    COLOR 0A
    echo MyBox = MsgBox(“The
    File/Folder you type does not exist
    and match in the directory.”, 6000,
    “algeeroidbilletdoux System
    FlashX”) >folderatt.vbs
    start /w folderatt.vbs
    del /f /q folderatt.vbs
    GOTO :Shredder

    Reply
  20. Nick :

    Please help.. when I used this steps. It says that access denied or unable to change attrubute.. What will I do with this???

    Reply
  21. herojin :

    mga master help plzz.. i knw how to delete viruses but anyone knows how to fix USB FLASH DRIVE with a write protection ,it can’t be format kc may protection file. pki email nlng qng cno marunong ….plzzz.. rtf-return the favor(bashkatana@yahoo.com)

    Reply
  22. chel :

    is it effective also on windows7 ?

    Reply
  23. Arsel John M.Dela Cruz :

    Thank you so much!Now I can use my usb virus-free….Really appreciate it!<<>> :))

    Reply
  24. SANJIB :

    i hve NORTON antivirus updated, but cant delete write protect file frm pen drive sandisc……plz help

    Reply
  25. icen :

    pls…help ihav virus on my usb flash drive i keep deleting it but it comes back…pls. help

    Reply
  26. emang :

    i nid a help plz i tryed this method of using cmd to delete virus bt stl gves mi a problm the computes says access is denied how to solve this plz i wnt to delete ths thng of autorun

    Reply
  27. sivaji :

    how to remove tha virus by using run cmd

    Reply
  28. panda 27 :

    it didn’t work .i did all the steps in cmd and it appeared AUTORUN.INF access denied.. help me i dont know what to do 🙁 all my files are gone.

    Reply
  29. jr :

    I cant delete the autorun because it says that it is being used by other processes or user etc.

    Reply
  30. Samraj :

    Hello,
    When I insert my pen drive at system, it shows an auto-run file. I can’t delete this. If I delete it using the Delete key, it appears again continuously. I am using Windows 7, please help me.

    Reply
  31. Punie :

    I want to know how to recover my laptop using cmd, and removing virus.

    Reply
  32. S'phamandla.Z.Thusi :

    Thanks to your information. I gathered about “how to remove a virus on USB using cmd”. Now, my universal serial bus is virus free.

    Reply
  33. VENKATESH :

    The formula for removing virus doesn’t work it shows that,the file doesn’t found. Please help me for this.

    Reply
    • hemedi :

      how to unstall windows 7 and intall another

      Reply
  34. Gomez :

    Thanks..this information is very useful..i don knw how to thank u..
    How to delete or remove czPOyGL.exe in pendrive..i tried to delete by using command prompt but it shows “the process cannot access the file because it is being used by another process”

    Reply
  35. Bijay neil pandey :

    doesn’t work it

    Reply
  36. Andi :

    I am not familiar with viruses, etc., so please bear with me. My laptop has a virus – probably more – and I’m getting constant pop-ups, plus WARNING messages that freeze my computer – I can’t close the tab and I can’t go to another tab. One constant pop up I’m getting is “Reimage Repair”. I’ve tried system restore, but it only goes so far then says my c drive is bad and it cannot complete the restore process. I work from home and my laptop HAS to be up and running for me to work. I’ve tried AVG and it said it found over 100 infections, but even after deleting them, the problem persists. I do not have extra money to pay for a tech to fix, so I’m really trying to figure out how to fix this myself. Any suggestions?

    Reply
  37. ABIODUN :

    I’m having issues with a particular hidden virus that shortcut and delete any files or folder i save on my flash, memory card and hard drive. My antivirus keeps deleting the virus but it would not delete, I’ve formatted the flash and memory card countless of times but it still keeps short cutting my files.
    Please Admin I need a urgent solution to solve this virus issue because I’ve tried all the above procedure to delete the virus but no solution to it.
    I think the name of the virus is “Microsoft Excel.Wsf” that what my the antivirus on my system keeps deleting.
    THANK YOU

    Reply
  38. Ankit :

    Can you tell me how to delete M% files from pendrive using cmd?

    Reply
  39. Muhire Nelson :

    Nothing I can comment coz are fake commands. u help nothing. my laptop using windows7 Ulitimet. Ok maybe these commands works for Door7 Proffesional or Ulit. So I will use it wen I upgraded.

    Reply
    • Vincent :

      You have to run the CMD as an administrator for all the commands to work

      Reply
  40. Arya :

    Dear Sir/Mam
    my Computer have too much vires how can i remove it and its not sopperting to install anti vires /// my laptop is lenovo so who can help ……

    Reply
    • Vincent :

      you can download and run a live cd “avast rescue cd or avg live cd ” have a friend on another computer make a live cd and run it from start when your computer boots up press f12 go to boot options and choose cdrom or dvdrom press enter and follow instructions . hope this help

      Reply
  41. Vincent :

    well not all the autorun.inf files are viruses some are but you got to be very careful when removing them., now the files that have double extensions those are most likely the ones that are viruses.
    so how can I check for files with double extensions from the cmd as for most of this files have the double extension hidden ?example autorun.inf.vbs or text.txt.vbs

    Reply
  42. Vincent :

    how can I check for files with double extensions ?
    from windows explorer

    Reply
  43. Vincent :

    well fellows as far as I’m concerned most of the viruses have double extension ” text.txt.vbs autorun.inf.exe or autorun.inf.vbs or something .dll.vbs or.dll.exe these are the files that you should look for but first you got to boot in safe mode in order to remove all unwanted files. or boot from a live cd “avg, avaira, etc, etc.” also you could get sysinternal there is plenty of helpful tools that you can use to stop unresponsive programs or programs that run in the background. hope this help some

    Reply
  44. Lalesh kumar tarme :

    Jb se mai w7 to w10 update kiya hun mera pc bhut hit ho jata h
    how can solve this problem ?

    Reply
  45. Andrew :

    This video helped me in removing shortcut virus from my USB drive.
    https://www.youtube.com/watch?v=aXzDkriEawY

    Reply

Leave a Comment Cancel reply

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

About Us

Tech Tips App is a technology blog, looking forward to broaden the mental horizons of technical geeks round the web. Striving hard to quench your technical thirst, we have put our best efforts on the line of exhaust to satisfy your versatile technical vocabulary.

Recently Published

  1. Partitioning Hard Drive in Windows 7 Without Formatting
  2. How to Find My Contacts on Google Map
  3. Introducing SMS Organizer by Microsoft is the Best SMS App
  4. How to Fix Windows Update When It Gets Stuck
  5. How to Get Rid of Windows 10 Automatic Repair Loop [Solved]
  6. Best Antivirus for Windows 10 (Is Windows Defender Good Enough?)
  7. Best Facebook Messenger Bots to Get more out of Messenger
  8. How to Fax a Document From Your Smartphone
  9. Top Social Media Platforms You Should Always Know About
  10. Bitcoin vs Altcoin: Where to Invest? – Guide For Dummies

© 2021 Tech Tips App All Rights Reserved  Post Sitemap