GetUSB.info Logo

How To: Remove a Virus From a USB Stick

How To: Remove a Virus From a USB Stick

The easiest way to remove any virus from a USB stick is this: format it!  Be sure to use the Full Format function, not the quick format function.In the very unlikely event you get an error messages saying you cannot format the drive because it’s being used by another program, or for some reason you have data on there you don’t want to format off, then you can try the following. Before I start however, let me explain the fundamental concept of what we are trying to do. With most virus’ they make it very hard to delete the files so they can spread their infection.  To do this, they use several files and ping each other so they appear to be in constant use.  This is why you see the error “being used by another program cannot delete or format.”  So what we need to do, is stop that process.  In addition, programmers put in attributes to make it hard to delete as well.  For example they set the file attribute to Archive, or System File so we’ll need to remove those attributes too. So lets start:  In Windows go to START > RUN.  In the field type cmd This will open the DOS command prompt.  Here you should be at the C drive root.  If not type cd\ and click return.  You will then be at the C:\ root.

USB root

Next type the drive letter of your flash drive.  In my example that is drive letter F.  You can find the drive letter of your flash drive by going to START > MY COMPUTER > and look for the “Removable Disk“Next, type the drive letter, so for me, type f: and hit enter. After you are in the drive letter of the flash drive, type dir/w/a

This will list all the files in your flash drive, regardless of it’s attributes of being hidden, System file or archive. Now we should look for suspicious files such as anything listed as a .exe file or a .inf file.  Specifically anything with a autorun.inf should be deleted.  Some other popular ones are Ravmon.exe, svchost.exe, Heap41a and pagefile.pif. If you see any of these, then lets remove all the file attributes and try and delet them. To remove all attributes do the following: In the DOS command prompt type attrib -r -a -s -h *.*  This command will remove all attributes for all files. Now we can delete the files.  You do this by typing del filename [be sure to include the exentions too, for example type del autorun.inf and hit enter.

This should do the trick if you’d like to remove problem files without running the Full Format function.

Copyright © 2006-2019

USB Powered Gadgets and more...

All Rights Reserved

GetUSB Advertising

The opportunities on our website reach at least 1,000 unique visits per day.

For more information
Visit our advertising page.

Nexcopy Provides

USB copy protection with digital rights management for data loaded on USB flash drives.

Contact us learn more