How to Recover Hidden Files in Pen Drive Caused by Virus

In this post, we are going to show how to Recover Hidden Files or unhide them in Pendrive or memory cards caused by the Shortcut virus. See the step-by-step simple guide to recovering your lost data.

Recover Hidden Files or Unhide Files in USB Pen Drive:

Sometimes the folders in your Pendrive or USB drive turn into shortcuts and all the files disappear from your USB Drive. Your USB drive appears empty even if the data is present. Also, the computer shows that Pen Drive is using blank space but it does not show files or folders. Actually, this problem is caused by a virus called “Shortcut Virus”.

When you connect your USB drive to an infected PC, this virus automatically infects your USB drive and makes your data disappear. In this article, we will discuss and show you how to easily remove shortcut viruses from your removable drive and recover your data without losing it.

How to recover hidden Files in Pen Drive
Recover Hidden Files in USB Drive

Removable media like a flash drive, memory card, and external hard disk are essential computer accessories and common devices to transfer data from one computer to another. But sometimes, when we connect our USB to a computer, It appears that all the files are missing from the drive and it only shows some folder’s shortcuts, or sometimes the drive shows empty even when data exists.

When we are in hassle, this problem causes a lot of trouble. All the files and folders in the pen drive are just shown as shortcuts and are not accessible. This problem is caused by a virus called Shortcut Virus. In this article, we will discuss and guide you on how to easily remove the shortcut virus from your USB drive or Memory Card without losing your important data and recover your lost files in that Pendrive.

How to show hidden files in a USB drive caused by Shortcut virus:

When we connect any pen drive or any removable media to a computer and if the drive or media is already infected by the Shortcut virus, our pen drive automatically gets infected and started to show our folders as a shortcut, or sometimes it just shows only one shortcut.

You can simply format the flash drive to directly remove the virus. But it is not a good idea to remove the Shortcut virus. Formatting the USB drive will remove all the important data along with the virus from your drive.

(Also read)

[Learn how to compress 1000 MB files to just 10 MB using 7 Zip]

But, not to worry about this. A short and simple piece of command can easily make your flash drive accessible and you will get your files back. 

First of all, connect your infected pen drive or memory card to your PC. Now you have to open the “CMD” program. To open CMD, click on the start button and type cmd in the search box as shown in the below picture. Now right-click on cmd and click the “Run as Administrator” option to start cmd.

Process to Recover Hidden Files : Search for CMD in start menu
Search result for cmd in the start menu

If you are unable to use this method to open the cmd program for any reason, Then open the RUN Command Box from the start menu or simply press the Windows key and R at the same time (Win+R) on your keyboard to open it. Now type CMD in the run command box and press OK to open the cmd window.

CMD command box example
Type cmd in the run command box

Now we have to find the drive letter of the infected drive to use in the CMD command in our computer (see, what is drive letter). To know the drive letter, open My Computer and find the letter of the drive as shown in the image below:

how to find drive letter in my computer
Drive letter example

In the CMD window, first, enter the Drive Letter followed by a colon sign (:) without any space between the letter and the colon sign, and then press enter. Now the default drive letter (C:) will be changed to the new drive letter (i.e. H: or I: etc). See the below image for an example. (Click on the image to enlarge)

CMD window with example
CMD window

Now type the following command/code in the cmd window after the new drive letter and press the ENTER button on your keyboard.

attrib -s -h /s /d

For example, if your drive letter is H, then your command will look like this:

H:>attrib -s -h /s /d   

(please add only one blank space before -s, -h, /s and /d)

See the below image for an example. (Click on the image to enlarge)

Use of the attrib command in the cmd window

Now, wait for a minute or two to complete the process. Once you have completed the whole process, you will again see the drive letter as H:> or according to the drive letter of your computer. now type “exit” and press enter again to close the cmd window. (for example H:>exit press enter).

Now open your pen drive in “Computer”. You will see a folder with no name on it. Open this folder to access your files. Done.

You can view these steps on YouTube here:

Command-line details:
  • attrib=attribute
  • ‘-‘ = remove attribute/permits
  • s = system
  • h = hidden
  • /s=sub directory
  • /d=directory

How to Remove Shortcut Virus from USB Drive:

The safest and easiest way to remove the Shortcut virus from a flash drive or memory card is scanning by it an up-to-date antivirus. You can download some popular and effective antivirus software here.

If you search the internet, you can find some posts about removing shortcut viruses by editing the Windows registry. But editing the Windows registry is not advisable if you do not have enough knowledge about Windows Registry. 


In this article, you have learned how to recover hidden files on Pendrive due to the shortcut virus. By following the above steps correctly, you can easily show or unhide your original files instead of the shortcuts.

Other Articles

Leave a Reply