Recover Files from a Virus Infected Hard Drive, Memory Card and USB Drive

Roxanne updated on Oct 12, 2020 to File Recovery | How-to Articles

When you lose files after a virus attack, you can try two possible virus file recovery solution here for help: clean your drive then recover virus infected data using cmd or recover with a professional data recovery software.

how to retrieve files from usb

How to clean your USB drive and how to retrieve files from USB? Here is the solution.

1. Open a command prompt ( Windows Key + R, then type cmd and press Enter ) and go to your drive by typing drive letter and semicolon like F: then press ENTER.

2. Run this command attrib -s -r -h  *.* and press Enter.

More items...

Have you ever been attacked by one or more unknown viruses? If you have such an experience, you will know that a virus attack can result in unexpected data loss on a hard drive, external hard drive, memory card, or a USB pen drive.

For users who have no idea how to recover virus infected files from USB, it can be a real disaster! But don't worry! On this page, we will introduce to you two possible solutions to retrieve files from USB: repair and recover virus infected files using CMD and recover virus infected files with a professional data recovery software. These solutions should be executed in succession. If the first one doesn't work out, then continue to the second method. 

1. How to Retrieve Files from USB Using CMD 

When your data is hidden, inaccessible, or lost due to a virus attack on a USB pen drive, your best bet is first trying to use the Command Prompt (cmd) to recover hidden files from virus infected USB. Since it is free and well-understood, cmd is an excellent choice. Now let's see how this works. (I will be using Windows 10 for this demonstration, but the process is largely the same for other OS versions)

1. Plug your external hard drive, memory card, or USB drive into your computer

2. Go to the start menu, type in "cmd" in the search bar, hit enter. You'll then see something named "cmd.exe" under a list of programs.

Use CMD to recover files from virus infected storage media step 1

3. Click "cmd. exe" and then you will be directed to the Windows command line that allows you to recover virus-infected files.

  • Type chkdsk E: /f and hit Enter. (Replace E: with the drive letter of the device or location where you have virus-infected files.)
  • Type Y and hit Enter.
  • Type E: and hit Enter. (Replace E: with the appropriate drive letter.)
  • Type attrib -h -r -s /s /d *.* and hit Enter.  

Windows will then start to repair the virus-infected external hard drive, memory card, or USB drive. The repair usually takes one or two minutes. Please wait patiently. After the repair process, navigate to your disk or card and check if you can see all of the previously virus-infected files on your USB/pen drive, memory card, or external hard drive.

If YES, congratulations! But if not, don't despair. You have another option. Just try a third-party data recovery software in Solution 2!

2. How to Recover Files from USB with EaseUS Data Recovery Software 

When you fail to recover files from virus infected USB using cmd, EaseUS hard drive data recovery software comes to solve your problem. This program is a professional recovery software for all storage devices. With its powerful file recovery utility, you can effectively recover deleted, corrupted, or hidden files from virus-infected internal hard drive, external hard drive, memory card, and USB drive/pen drive. Besides, it's also capable of recovering files from emptied recycle bin. 

Follow the step-by-step tutorial below to start recovering files from virus infected USB drive. 

Step 1. If a virus infects your USB or SD card, connect it to your PC before running EaseUS Data Recovery Wizard. Then, choose the virus affected drive/device, and click "Scan" to start scanning the drive.

select a location and click scan

Step 2. Let the program scan the selected drive, and all data deleted by the virus will be found. You can double-click on them to check out whether they are usable.

scan deleted files

Step 3. Select the files you need, then click the "Recover" button to save them to a secure place instead of the original location.

Restore lost data from drive which was infected by virus

People Also Ask

1. How show hidden files from virus infection in pen drive?

To recover hidden files from virus infected USB pen drive, you can use the two solutions in this article, one is using the attrib command lines and the other is applying a professional virus file recovery tool to recover infected files.

2. How can I recover files from virus infected USB?

Step 1. Go to Start menu and type cmd in a search box and press Enter.

Step 2. Click cmd. exe and then you will be directed to the Windows command line.

Step 3. Type attrib -h -r -s /s /d G:\*. * (Replace G with your drive letter) to recover virus infected files.

3. How do I recover hidden files on my USB?

You can view and retrieve hidden files from USB In the File Explorer options. select View, click Hidden files and folders and click on Show hidden files, folders and drives. Click Apply, then OK. This operation will make your hidden files visible on the USB drive.

4.. How can I remove virus from my USB without deleting files?

You can remove virus from USB pen drive without losing data in the following way.

Step 1. In the Search box, type cmd to open the command prompt. 

Step 2. Now, type your flash drive letter (for example J) followed with colon i.e. F:

Step 3. Type attrib -r -a -s -h *. * and press enter.  

Was This Page Helpful?


Frequently Asked Questions

1. Why choose EaseUS Data Recovery Wizard?

"EaseUS Data Recovery Wizard is the best we've seen. It's far from perfect, partly because today's advanced disk technology makes data-recovery more difficult than it was with the simpler technology of the past, but it's fast and efficient..."PCMag

"The first thing you'll notice about EaseUS Data Recovery Wizard Pro is that its interface is very clear and uncluttered, with only a small collection of self-explanatory controls. You won't find lots of extra options hidden in a system of hidden menus, either; what you see really is what you get."techradar

"Recover lost files, even after deleting a partition or formatting your drive."Macworld

2. Why cannot I recover 2GB data for free?

It is recommended to check the version installed is Free or Trial because they are different versions.

Trial has data preview function but cannot save any files, while the Free version enables to recover 2 GB files. The default free space is 500 MB and you may share the product on social media to get another 1.5 GB.

3. Why cannot the recovered files be opened?

A file is saved as 2 parts on the storage device: directory info (which is comprised by file name, time stamp and size info, etc.) and data content.

If the files with original file names and folder structures cannot be opened, one possible reason is the corrupted directory info. There is still a chance to recover the data content with the RAW Recovery method in our software.

4. Why isn't it suggested to recover the files back to the original drive?

The storage structure of the lost files would be altered or damaged by any changes on the drive. If you save the recovered files back to the same drive, the original data structures and data content would be corrupted or overwritten, which causes permanent data loss. So you should prepare another disk to save the files.

5. How can I check whether my data is recoverable or not before purchase?

The Free version helps you save 2GB files, so verify the recovery quality of our product before purchase.

6. How long does it take to scan the drive?

It strongly depends on the capacity of your hard drive and the performance of your computer. As reference,most drive recoveries can be completed in around 10 to 12 hours for a 1-TB healthy hard drive in general conditions.

About Data Recovery Wizard

It's super easy to recover 250+ types of files after deletion, disk formatting and virus infection. Click the links and compare the difference of each version.