• Home

  • Virus From a Flash Drive

How To Remove Virus From a Flash Drive?

A flash drive is a removable storage device you can connect to your computer via a USB port. They are prone to get infected with viruses and malware. Once inserted into infected computers, the pen drives or flash drives acquire them. You have to delete the infected files by launching the command prompt and scanning the device with a credible anti-virus software. The following steps provide solution for how to remove virus from a flash drive.

Insert the USB

  1. Plug the infected flash drive into the computer’s USB port.
  2. Hold on while the computer registers it.
  3. Make a note of the drive letter is assigned to the drive.
  4. The OS displays a window asking what is to be done with the drive.
  5. Close the tab by clicking Cancel.

Command Prompt

  1. Click Start > Run. The Run command box is launched.
  2. Type cmd in the search box and hit Enter.
  3. Enter the letter of the flash drive along with a colon.
  4. Press Enter.

Locate the Virus

  1. Type dir/w/a in the Command Prompt and hit Enter.
  2. Now, you’ll be able to view the files within the flash drive.
  3. You might find unknown or corrupted files in the flash drive.


  1. Type attrib-r-a-s-h in the Command Prompt and hit Enter.
  2. This command will disable the infected files attributed with hidden, read only, archive, and system.

Delete the Infected Files

  1. Type del filename in the Command prompt.
  2. Hit Enter.
  3. The specified file is deleted from the flash drive.

Scan with an anti-virus program

  1. Launch the anti-virus program and perform a scan on the flash drive.
  2. You’ll be shown a report on the infected files or viruses.
  3. Eject the drive safely from the computer.
  4. Type dir/w/a in the Command Prompt and hit Enter.
  5. See if you can find any unknown or suspicious files within the drive.
Antivirus Scan Process Guide

Guide: Shortcut Virus

How to Remove Virus from a Flash Drive Support. Shortcut viruses are common in flash drives. If it is a computer virus, the folders on your desktop file are replaced with shortcut icons. In case of a USB flash drive virus, it takes all of your files and attributes them as hidden. An application file named shortcut.exe is created. Upon opening the file, the virus is activated and begins spreading to the computer into which the infected USB drive is plugged.

Follow the steps below to remove a shortcut virus

  1. Insert the USB into the computer.
  2. Right-click the Command Prompt and select Run as administrator.
  3. Enter the USB’s drive letter and press Enter.
  4. Type attrib-s-r-h *.*/s.d/l/ and hit Enter.
  5. Open the flash drive and check its contents for any malicious files.

Guide: Autorun Virus

The autorun is another virus common in flash drives. When a drive is infected, the window appears as autorun.inf. When the OS opens the file, the virus is activated.

Delete the file as follows

  1. Open the flash drive.
  2. Delete the file named “autorun.inf”.
  3. Reboot the computer and type cmd in the search bar.
  4. The command prompt should be opened.
  5. Input the drive letter of the USB and press Enter.
  6. Type attrib-r-s-h autorun.inf and hit Enter.
  7. Restart the computer.

For, instant solution for how to remove virus from a flash drive or other virus issues contact our experts.

Installation Guide