PDF download Download Article
A simple and easy guide to getting rid of a virus on a flash drive
PDF download Download Article

This wikiHow teaches you how to scan for and remove a flash drive virus using a Windows PC. You'll also learn how to use your desired MacOS antivirus software to scan your Mac for threats (although USB flash drive viruses are extremely rare, if not extinct, on Macs). If your flash drive is infected by a shortcut virus, which is when your files are hidden and replaced with identical shortcuts, you can remove it by running a few commands. Other viruses can be removed by reliable antivirus software such as Windows Security (free with Windows 10), Norton, Kaspersky, AVG AntiVirus, or McAfee. If you don't have antivirus software, you can download a quick tool from Microsoft that will scan for (and remove) viruses.

Method 1
Method 1 of 4:

Using Windows Security (Windows 10)

PDF download Download Article
  1. If you're prompted to view the files on the drive or change your USB settings, just close the window for now.
    • Back in 2011, Microsoft changed Windows so that files on USB drives cannot run unless you actually open the drive's contents and click the file name. [1] This is why you generally won't find "autorun" viruses on flash drives anymore.
    • If you're using third-party virus protection like Norton, McAfee, or Kaspersky, you can use that application to remove viruses from your flash drive instead. Sometimes the virus software will launch automatically as soon as you connect the drive and give you the option to scan. [2]
  2. You'll find this gear-shaped icon near the bottom of the Windows Start menu.
    Advertisement
  3. It's the option with two curved arrows.
  4. It's the option with a shield icon in the left panel.
  5. It's at the top of the right panel.
  6. It's the shield icon at the top-left corner of the right panel.
  7. It's the blue link under "Virus & threat protection settings." This checks for changes to Microsoft's virus database and downloads any necessary updates.
  8. It's under the "Current threats" header at the top of the right panel.
    • If you're using a different antivirus solution than Windows Security, you may see the option to launch that application instead. Open your antivirus program and run a scan on the flash drive.
  9. It's the button at the bottom of the right panel.
  10. It should be under "This PC" or "Computer" toward the bottom. You may have to click the small arrow next to one of those options to display the connected drives.
  11. It's the button near the bottom-right edge of the dialog window. Windows will now scan your flash drive for viruses.
    • This can take a while if you have a lot of files on your flash drive.
  12. Once the scan is complete, you'll see a window that tells you whether any viruses were detected. Windows Security will guide you through the virus removal process if any viruses are found.
  13. Advertisement
Method 2
Method 2 of 4:

Using Microsoft Safety Scanner (Windows 8.1 and Earlier)

PDF download Download Article
  1. If you're prompted to view the files on the drive or change your USB settings, just close the window for now.
  2. Go to https://docs.microsoft.com/en-us/windows/security/threat-protection/intelligence/safety-scanner-download . This is the website for Microsoft Safety Scanner, a free up-to-date antivirus and anti-malware removal tool for Windows. If you're using Windows 8.1 or earlier and don't have antivirus software, this will be the fastest way to detect and remove viruses on your flash drive.
    • Microsoft Safety Scanner is a portable application, which means it doesn't have to be installed or removed. [3]
    • If you're using third-party virus protection like Norton, McAfee, or Kaspersky, you can use that application to remove viruses from your flash drive instead. Sometimes the antivirus software will launch automatically as soon as you plug in the drive and give you the option to scan. If nothing pops up automatically but use third-party antivirus protection, launch your antivirus software and run a scan on your flash drive.
  3. There are two versions of the link: one for 32-bit systems, and one for 64-bit systems. Click the version that matches your PC, and follow the on-screen instructions to download.
    • If you're using Windows 8, open the Control Panel , and select System .
    • On Windows 7, open the Start menu, right-click Computer , and select Properties .
  4. To do this, double-click the file you just downloaded, which will be called something like MSERT.exe . You'll find it in your default download location, which is usually the Downloads folder.
    • After launching the app, you'll typically have to click Yes to run it and/or enter your password.
  5. After reading the agreement, click the box to add a checkmark. This confirms that you understand Microsoft's terms.
  6. It's the third option.
  7. This opens your PC's file browser.
  8. It's likely at the bottom of the list.
  9. The tool will now search for viruses on your flash drive. It'll also do a quick scan of your hard drive to check for viruses there as well. Once the scan is complete, the results will appear.
    • This can take a while if you have a lot of files on your flash drive.
  10. Once the scan is complete, you'll see a window that tells you whether any viruses were detected. Microsoft Safety Scanner will guide you through the virus removal process if any viruses are found.
  11. Advertisement
Method 3
Method 3 of 4:

Removing a Shortcut Virus

PDF download Download Article
  1. This type of virus places all files on your USB into a hidden folder and replaces them with shortcuts of their original names. You can usually tell you have a shortcut virus if you see small arrows over the file or folder icons. If you double-click any of these shortcuts, the virus will activate and spread to your PC. [4] .
  2. If you're prompted to view the files on the drive or change your USB settings, just close the window for now.
    • You'll need to know the drive letter of your USB drive (e.g., F: or D:) to remove the files. If you're not sure what it is, press the Windows key and the E key on the keyboard to open File Explorer, and then scroll down on the left panel to find your flash drive and corresponding drive letter. You may have to click an arrow or plus symbol next to "This PC" or "Computer" to see the drive.
  3. A list of results will appear.
  4. A menu will expand.
  5. This opens an administrator-level command prompt.
    • You may be prompted to verify your password to open up the window.
  6. Be sure to include the colon (:) after the letter.
    • For example, if your USB drive is the F drive, type F: and press the Enter key.
  7. To do this, type del *.lnk and hit the Enter key.
  8. To do this, type attrib -s -r -h /s /d *.* and press the Enter key. If your drive was infected by a shortcut virus, this should restore your files to their original locations safely.
    • To see a list of files on the drive, type dir /s and press the Enter key.
  9. Now that the virus is removed, it's a good idea to format the drive and start from scratch. If you don't want to lose your files, copy them to another location on your computer. Scan through the items on your USB drive and delete any unfamiliar files and folders first. [5] Then, see How to Format a Flash Drive to learn how to erase and format the drive.
  10. Advertisement
Method 4
Method 4 of 4:

Scanning a USB Flash Drive on a Mac

PDF download Download Article
  1. 1
    Insert your USB flash drive into your Mac. It's not possible to install malicious software from a USB drive on your Mac, so you generally won't need to scan your USB drives for viruses. [6] If you'd like to check for viruses anyway, as well as other types of malware, you can use your antivirus software to scan external drives.
  2. 2
    Install antivirus software if you haven't already. If you already have antivirus software, you can use it to scan your USB drive for viruses. If not, one free option is AVG AntiVirus—although there is a paid subscription option that protects your Mac over time, the free version works great for this purpose. [7] To install AVG:
    • Go to https://www.avg.com/en-us/avg-antivirus-for-mac .
    • Click the green Free Download button in the top-right area of the page. If the download doesn't start automatically, click click here near the center of the page to start it.
    • Once the installer is finished downloading, you'll see a floating arrow on the AVG page that says "OPEN your downloaded file." Click the location indicated by the arrow to launch the installer.
    • Follow the on-screen instructions to install AVG.
  3. 3
    Open your antivirus software. You can do this by double-clicking your antivirus software's name on the Launchpad or in the Applications folder in Finder.
    • If you're using AVG AntiVirus, you can also click the shield icon in the menu bar near the top-right corner of the screen and select Open AVG AntiVirus . [8]
  4. 4
    Update the virus definition files. These files must be downloaded from the internet on a regular basis to keep your software up-to-date. The option will usually be clearly marked as Update virus definitions or something similar. In AVG, click the two curved arrows near the bottom-right corner to run the update. [9]
  5. 5
    Set the antivirus software to scan external drives. The location to do this will vary, but you'll usually find such an option in the Preferences menu of the app. Here's how you'll do this in AVG AntiVirus:
    • Click the AVG AntiVirus menu near the top-left corner of the screen and select Preferences .
    • Click the Scanning tab.
    • Check the box next to "Scan external drives and shared folders."
    • Click the red circle at the top-left corner of the window to close it.
  6. 6
    Click the Scan option to start the scan. Depending on the software, you may have some options like Deep scan and Quick Scan . A Deep scan is more thorough but takes a lot longer. Try a Quick or Basic scan first, and then do a deeper scan if desired. Once the scan is complete, you'll see a list of any threats, if any, that have been found by the software.
  7. 7
    Follow the on-screen instructions to remove problematic files. For example, if you're using AVG AntiVirus, click Resolve next to any viruses or malware on the list to move them to Quarantine. Quarantined viruses can no longer harm your computer or flash drive.
  8. Advertisement

Expert Q&A

Search
Add New Question
  • Question
    If I already have antivirus software, how do I remove a virus?
    Luigi Oppido
    Computer & Tech Specialist
    Luigi Oppido is the Owner and Operator of Pleasure Point Computers in Santa Cruz, California. Luigi has over 25 years of experience in general computer repair, data recovery, virus removal, and upgrades. He is also the host of the Computer Man Show! broadcasted on KSQD covering central California for over two years.
    Computer & Tech Specialist
    Expert Answer
    Plug the flashdrive into the computer. If you already have antivirus software, you should be able to right-click on the USB's icon when it loads and run the software. This should take care of removing the virus.
  • Question
    How can I know the drive's letter?
    Community Answer
    It actually is just beside the drive's name; for example wikiHow (G:), then G: is the drive's letter.
  • Question
    How do I fix runDLL errors?
    Community Answer
    There are multiple causes for runDLL errors, such as the specific module couldn't be found. If the error is happening because some files weren't removed during uninstallation of the program, which would lead to a corrupted registry (i.e. some files are missing from the local folder), you can fix the issue by opening up the RegEdit, finding the specific module that's not found, and deleting it. You can also open up Task Scheduler, delete the entries in the Task Scheduler Library, and reboot. If some specific DLL file is missing, search the Internet for the required DLL file, and install it using the given instructions (i.e copy and paste the DLL files in C:/System32 in the folder as shown in the install instructions for the DLL file). You can find the instructions at the site you download the DLL from. You may have to reboot afterward. Otherwise, just search for the error online.
See more answers
Ask a Question
      Advertisement

      Video

      Tips

      • Update your PC frequently to improve protection against security vulnerabilities, including viruses.
      • Try scanning all the files you would like to copy to your computer to see if they're safe and not infected. If it's a picture you love and it's infected, print it out before deleting it, then scan it back to your computer. You'll thank yourself.
      • Always scan your computer after this procedure as the virus could migrate from the external USB storage device to your main drive.
      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Name
      Please provide your name and last initial
      Thanks for submitting a tip for review!
      Advertisement

      Warnings

      • Every file you copy could be infected, if you can't afford to lose an infected document or picture, print it out and scan it back to the computer from paper.
      • If you find a flash drive on the ground or in some other public space, don't try to access its files on your computer. Hackers often plant infected flash drives in populated locations, hoping that people like you will try plugging it in. [10]
      Advertisement

      About This Article

      Article Summary X

      1. Insert your USB flash drive.
      2. Scan the entire computer with your antivirus software.
      3. Open the Command Prompt as an administrator.
      4. Enter your computer's drive letter and press Enter .
      5. Type "del *.lnk" and press Enter .
      6. Type attrib -s -r -h *.* /s.d/l/ and press Enter .
      7. Type "format /q /x DRIVELETTER: and press Enter .

      Did this summary help you?
      Thanks to all authors for creating a page that has been read 737,664 times.

      Reader Success Stories

      • Ivars Dille

        Dec 4, 2016

        "The explanation of what a shortcut virus is helped me. I had already opened the infected file (the result was ..." more
      Share your story

      Is this article up to date?

      Advertisement