Wondershare Recoverit

USB Drive Recovery

  • Recovers deleted or lost data from USB drive effectively, safely and completely.
  • Supports data recovery from 500+ data loss scenarios, including computer crash, partition loss, accidental human error, etc.
  • Supports 1000+ file formats recovery with a high success rate and without any quality loss.
Recover Now Recover Now Recover Now Learn More >

How to Recover Files from the Virus Infected USB Drive

Wondershare Recoverit Authors

Jul 17, 2024 • Filed to: USB Recovery • Proven solutions

My USB flash Drive got virus-infected, and I lost all of my data in it. How can recover my USB drive? Is there anyone who can help me?

Have you ever been bothered by such situation when your USB get infected by some virus? Indeed, viruses and malicious files are very annoying when they attacked your devices. They could come from external devices such as USB Drives, Hard Drives, etc. and damage your essential data like videos, photos, and documents.

In this article, you are going to learn the best methods to recover files from virus-infected USB drives. Furthermore, you can also learndown some best practices which you can follow to keep your PCs well-protected from viruses. Everything you need to know about how you can prevent your system from malware is given here. You can also see from: Steps to Delete Malware/Viruses from Your Computer

Before you start to learn the useful solutions, you need to understand the following two things:

1. Why will the USB get infected by a virus?

A pendrive gets infected when a user plugs it on the virus-infected PC. The other way with which a pendrive gets infected is by placing the virus code to your connected drive. This happens when a user explores infected websites and downloads something from those websites while the Pendrive is connected. Also see from this article: Methods to Recover Lost Files from Trojan Virus Attack

2. Can your files in virus-infected USB get recovered?

Yes. Many PC users are struggling to find a way to get rid of viruses and malicious files from their computer systems and pen drives. Thankfully, you can easily remove such files from a USB device by following simple methods. We will describe all the working methods and solutions later in this article.

Content Page:

[3 Solutions] How to Recover Files from Virus Infected USB

Here comes the most important part that you are concerned with. There are multiple solutions that you can try for data recovery of the virus-infected USB drive. Here, we have listed down all the solutions with proper instructions. You can follow any of these solutions as per your preference.

Solution 1: Using Recoverit to Recover Deleted Files

Step 1: Download, Open Recoverit and Select Target Drive (USB)

Next, you need to download and install the Wondershare Recoverit on your PC and then open it. Once opened you must "select" the target drive (USB) from which you desire to retrieve your lost, missing or deleted files. After selecting the target drive (USB) hit the start to begin scan for your files. and then open it.

download and install the recoverit

Free Download | Win Windows Version Free Download | Mac Mac Version
article-safe-itemSecurity Verified. 3,591,664 people have downloaded it.

Step 2: Scanning the Target Drive (USB)

The scan will begin once you hit start, after which you must be patient and wait for the scan to conclude to get the result.

select the target drive you desire and hit scan

Step 3: Preview & Recover Files

After the scan is done, its result will then be presented so you could preview, sort and select the files you desire to recover. After sorting through results, tap on the files you desire to restore and save them to your desired storage location.

preview recovered photos

Solution 2: By Using Command Prompt

Obviously, this is the simplest solution to recover your lost data. Let's see the steps below.

Step 1: Make sure that the external drive i.e. USB drive or Memory card is plugged into the PC’s USB port. Just plug the external drive into the PC system, do not open it.

recover files from virus infected usb by using cmd

Step 2: Open the Command Prompt Window. Go to the Start menu, press Win+ R keys to open the Run Wizard.

find run option

Step 3: In the search box, type in cmd and then press the Enter button.

type cmd into the run option

Now, you have to enter the following command in the Command Prompt Window by using your Keyboard. Once the command is added, click the Enter button: attrib -h -r -s /s /d :\*.*

Note: Make sure to enter the drive name as per your PC. Go to My Computer and check the disk of the USB drive, replace the letter H with the current disk drive partition.

type command in the cmd window

Step 5: You’re done! The command will run itself and removes all the shortcut viruses and malicious files from the connected drive.

Solution 2: Formatting the USB Drive

Step 1: Connect the USB Drive to your PC system. Do not open the drive, just connect it via the USB port of your PC.

connect usb drive to your pc

Step 2: Go to the Desktop and click the My Computer's icon. From here, select the USB-drive.

go to this pc and select usb drive

Step 3: Right-click on the USB flash drive and then click the Format option.

format usb drive

Step 4: At last, you would be asked to confirm the Format process. Click the Start option to initiate formatting the drive.

start formatting usb drive

The Format process will take a few seconds. After formatting the drive, you can use the recovery option to get your files recovered. Again, make sure to use a non-infected drive to store the recover data when you use such a tool.

If the cmd solution failed to retrieve your deleted files back, or the steps are more complicated for you. You can follow the next solution to recover files from virus-infected USB flash drive with Recoverit Data Recovery software. It is a professional USB flash drive recovery program that can easily help you recover deleted files from the infected USB drive.

Part 2: Tips to Prevent USB from be Infected by Virus

Comply with the tips given below to prevent your USB flash drive from the infection of viruses and malicious files.


This is how you can recover files from virus infected USB drives. To keep the drive safe from viruses and other infections, follow the tips given above. This way you can safeguard your drive from virus attacks.

For best results, we recommend Wondershare Recoverit Data Recovery. We chose this software here because it is highly reliable and safe with powerful functions which can surely solve your problem in easy steps, compared to the rest of the data recovery software available. Also, you can recover 100 MB files freely with it!

The software is there for Windows and Mac systems, give it a try now!

Recoverit author

Sue Wayne

staff Editor

Home > Resources > USB Recovery > How to Recover Files from the Virus Infected USB Drive