How to Recover Hidden Files in Pen drive Caused by Virus

  • Post published:3 October 2025
  • Post category:Blog
  • Post comments:0 Comments

Recover or Unhide Hidden Files in USB Drive or Pendrive:

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 the 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”.

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

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 folders’ shortcuts, or sometimes the drive shows empty even when data exists.

Also Read:

How to Compress 1GB files into just 10 MB

When we are in a 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 drive.

Steps to Recover Hidden Files in a USB drive caused by the 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 starts 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 viruses, from your drive.

But, not to worry about this. A short and simple 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 picture below. Now, right-click on CMDand 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.

Run 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 My Computer

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 command

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

Attrib command in the cmd window
Use of the Attrib command in the CMD window

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

See the image below for an example. (Click on the image to enlarge)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.

Watch this easy tutorial in this video to learn the steps easily:

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 to scan it with 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 the Windows Registry.

Conclusion:

In this guide, we explained how to recover hidden files from a USB pen drive that has been turned into a shortcut by the Shortcut Virus. By using the attrib command in Command Prompt, you can quickly unhide your files and protect your data. Always keep your PC protected with updated antivirus software to prevent future infections.

Other Articles

None found

You are currently viewing How to Recover Hidden Files in Pen drive Caused by Virus

Leave a Reply