You plug in your pen drive and every folder has turned into a shortcut, or the drive looks empty even though the space is still used. That’s the classic shortcut virus (also called the recycler virus). Good news: in most cases your files are not deleted, just hidden. Here’s how to bring them back and clean the drive on Windows 10 and 11.
Quick fix: Open Command Prompt, type
attrib -h -r -s /s /d E:\*.*(replace E with your pen drive letter) and press Enter. Your hidden files reappear. Then delete the .lnk shortcuts and any unknown .exe / .vbs files, and scan with Windows Security.
What is the shortcut virus?
It’s a family of worms that hides your real files (sets them to hidden + system), creates shortcuts with the same names and copies itself to every drive you connect. Clicking a shortcut runs the virus and opens the folder, so you may not notice at first. It spreads mostly through shared pen drives at print shops, colleges and offices.

Step 1: Unhide your files with CMD (attrib)
- Plug in the pen drive and note its drive letter in File Explorer (e.g. E:).
- Press Win + R, type
cmd, and press Enter. - Type
attrib -h -r -s /s /d E:\*.*and press Enter. Replace E with your letter. - Wait until the cursor returns (big drives take a minute). Open the drive; your real folders are back.
| Part of the command | Meaning |
|---|---|
| -h | Removes the Hidden attribute |
| -r | Removes Read-only |
| -s | Removes the System attribute |
| /s /d | Applies to all files and folders inside |

Step 2: Delete the virus files
- Delete every .lnk shortcut file on the pen drive.
- Delete unknown files like autorun.inf, random-named .exe, .vbs or .js files, and an unexpected RECYCLER folder.
- Tip: in File Explorer → View → Show → turn on File name extensions and Hidden items to see them.
Step 3: Scan the pen drive and your PC
- Right-click the drive → Scan with Microsoft Defender (Windows 11: Show more options).
- Run a Full scan in Windows Security → Virus & threat protection → Scan options.
- If the virus keeps returning, it’s running on the PC itself: check Task Manager → Startup apps and remove unknown entries, then run the Microsoft Safety Scanner (free).

Step 4: Recover files that were really deleted
If attrib didn’t bring everything back, some files may have been deleted. Stop copying anything to the drive, then try:
- Windows File Recovery (free from Microsoft Store): e.g.
winfr E: C:\Recovered /regular. - Recuva (free): choose the pen drive, run a deep scan, and restore to a different drive.
- PhotoRec (free, open source): for photos and documents on badly damaged cards.

How to stop the shortcut virus coming back
- Keep Windows Security / Defender on and updated.
- Don’t open shortcuts on pen drives from other computers; open the drive from File Explorer instead.
- Scan every shared pen drive before opening files.
- Back up important files to the cloud (see Google Drive tips).
- Format the drive (FAT32/exFAT) after copying your files out, for a completely clean start.
Related guides
- Remove pop-up ads and malware from Chrome
- Check data usage on Windows & Android
- Read websites offline
Frequently asked questions
How do I remove the shortcut virus from my pen drive without losing data?
Run attrib -h -r -s /s /d X:\*.* in Command Prompt (X = drive letter) to unhide files, then delete the shortcuts and unknown .exe/.vbs files and scan the drive.
Why did my pen drive files turn into shortcuts?
A shortcut virus hid your real files and created shortcuts in their place. The files are usually still there.
Does formatting remove the shortcut virus?
Yes, formatting cleans the drive, but copy your files out first using the attrib method.
The virus comes back every time. Why?
Your PC is infected. Run a full Defender scan, remove unknown startup apps and use the Microsoft Safety Scanner.
Can I recover deleted files from a pen drive?
Often yes, with Windows File Recovery, Recuva or PhotoRec, if you stop writing new data to the drive.




