My pen drive might be infected with virus/malware. I'm running Windows 7. I never stick it into an unsafe computer but this time I had to (because of some urgent work). I haven't inserted it into my computer since then. The pen drive currently does not hold anything important. I have Avast antivirus (free) installed.

I want to be able to use it again (not urgent this time). What should I do?

The pen drive contains a .pdf file, a .docx file and a .ico file. If I ensure that autorun is disabled and format my pen drive immediately after inserting it, would it be safe? Or is there still some chance that some malware might creep into my computer.

I don't want my computer to get infected and if it is unsafe to plug it in, I will not use that pen drive.

  • 1
    Do you know for a fact the "unsafe" computer you used was infected?
    – CharlieRB
    Jul 24 '14 at 11:54
  • No, but to be on the safe side I'm assuming so. That was a public computer (in a govt. office) and hundreds of people plug in their USB drives into that computer everyday. So it is highly likely that it was infected. Jul 24 '14 at 12:04
  • 1
    Not necessarily true. If it's connected to a government network it would likely have some protection. You're probably OK to plug in your drive, don't open any files, then scan it with Avast. Or just format it if you're that paranoid about it. Besides, if your Avast is up to date, it should protect you.
    – CharlieRB
    Jul 24 '14 at 12:20
  • Most government computers in India are not well protected. Most run Windows XP with no antivirus and they are very slow for a computer with that kind of hardware. "You're probably OK" indicates a doubt about safety. Jul 24 '14 at 12:44
  • 1
    As we know governments never purposefully infect computers to allow themselves to spy on the computers users. Jul 24 '14 at 13:06

About security, we should always have doubts. Having an up-to-date system and antivirus sotfware, and being sure of what you're doing help in most of the case.

That said viruses are designed before anti-viruses know about them (obviously), and some security flaw might exist in the USB subsystem. A firewire device have uncontrolled access to all the memory by it's design for example.

But statistically one thing is sure: you've way more chance to have a virus designed for Windows (especially after having plugged an USB key on a Windows computer) than any other OSes, another thing is that other OSes often have policies to disallow "normal" user to harm the system.

Knowing that, you can use a GNU/Linux Live distribution to save the file if they are important then format the USB key. Using a LiveCD should disallow any harm to your installed operating system, but if you still have doubts, you can disconnect your hard drive. Then (normally) nothing can happen

But nothing is 100% secure: if someone designed a virus specifically made for GNU/Linux which by an unknow security flaw can at the same time run an untrusted binary and get the superuser access, then add a virus to your BIOS (so it requieres being compatible with your hardware and knowing your BIOS' structure), then, perhaps your computer can be infected. That's very unlikely to happen.


Autorun should be disabled so it's safe to plug it in on a W7 machine.

This article shows how to re-enable it, you can easily work it backwards to ensure yours won't execute.

Bypass disabled autorun for USB devices on Windows 7

  • 2
    For better security, Always disable Autorun, always enable show-file-extensions, always disable file execution on removable media, usually disable Microsoft-Windows. Jul 24 '14 at 13:16
  • I disabled autorun and plugged the pen drive in. Nothing happened. I then formatted it. Later, when I turned on my computer again, a message box appeared saying something like "Recycle bin in I:\ has been corrupted". Since then, a folder named "$RECYCLE.BIN" has been showing up on all partitions of my hard drive. After that, nothing disturbing has happened and my computer seems to be functioning normally. So the moral of the story is that "you can't be 100% safe", especially on Windows. I should have at least made a restore point before plugging that pen drive in. Jul 25 '14 at 3:02

I would give you a simple solution for this. All you need to do is, start your computer in safe mode with command prompt.

Insert your Pen Drive

Go to your drive location. (Assume G:/ is the drive letter assigned)

In CMD, Type the following commands

G:/ (Hit Enter) , you will be taken into drive G:/

dir (Hit Enter), All the files and directories will be listed.

Check the list if anything suspicious. Delete the folder or file that seems to be malicious.

To delete entire folder , you may refer this link https://stackoverflow.com/questions/1965787/how-to-delete-files-subfolders-in-a-specific-directory-at-command-prompt-in-wind

To delete file,

del [drive:][path]filename

delete [drive:][path]filename

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.