USB Files Turned Into Shortcuts? How to Unhide Them
Our founder and lead technician, Joseph Montanti, handles cases personally.
USB files that suddenly appear as shortcuts are a familiar sign of the shortcut virus: malware hides the original folders and puts look-alike links in their place. The files may still be on the flash drive, hidden from File Explorer. Preserve the USB contents first. Use attrib on a separate working copy to reveal the hidden files. Cleaning the infected computer matters too, or the shortcuts can return.
On this page
Hidden folders and fake shortcuts
A Windows shortcut, with the extension .lnk, points to something else. In these infections, the link looks like one of your folders but launches malicious code. Some variants also open the real folder afterward, which makes the drive appear to work while the infection spreads.
The malware marks the original folders as hidden and system files. Windows normally keeps those out of view, so you see the replacements instead. Microsoft documents this behavior in its JS/Bondat description. That family also deletes certain file types, which is why finding shortcuts is a reason to look for the originals, rather than assume everything survived.
Preserve the USB contents before cleanup
Leave the shortcuts closed. Cancel any request to format the stick or run a program from it, and leave unfamiliar folders in place. If the stick slows to a crawl, drops out or produces read errors during the copy, stop and have it imaged for recovery.
Use an updated computer with antivirus protection running, rather than the machine that just produced the shortcuts. Before a manual cleanup scan or attribute changes, make a full copy of the USB contents to a separate drive. Copying only the visible shortcuts misses the hidden originals.
Windows includes Robocopy, which can copy the folder tree without opening the shortcuts. In Command Prompt, this example copies from USB drive E: to a new folder on drive D:.
robocopy E:\ "D:\USB-preserved" /E /COPY:DAT /R:0 /W:0
Replace both paths with yours. The destination must be on another drive with enough room. /E includes subfolders, and /COPY:DAT preserves file data, attributes and timestamps. The last two options prevent repeated attempts at a file that fails. Check the result for failed copies before proceeding; an incomplete copy leaves those files unprotected. If anything is missing or the copy failed, leave the original unchanged and recover from a full image.
The preserved folder may itself be hidden because it was copied from a drive root. You can reach it by typing its full path in File Explorer's address bar. Keep this copy untouched during cleanup, and treat it as infected until scanned.
Run the attrib command on a working copy
- Duplicate the preserved folder as
D:\USB-workingon separate storage. Keep the preserved folder untouched and disconnect the original stick. - In Command Prompt, run
attrib -h -r -s /s /d "D:\USB-working\*.*". Substitute the full path to your working folder. - Refresh File Explorer. Look for your original folders alongside the shortcuts.
- Before opening any recovered document, scan the working folder and quarantine detected threats there. In Windows 11, right-click the folder, choose Show more options, then Scan with Microsoft Defender.
- Copy the recovered, scanned files to a clean folder on another drive and check that the files you need open correctly. Only after that should you consider reformatting the USB stick for reuse.
The command clears hidden (-h), read-only (-r) and system (-s) attributes. /s applies it through subfolders, and /d includes directories. These are Microsoft's documented attrib options. None of them repairs damaged file contents.
If attrib says Access denied or File not found
Access denied: read the path beside the error. A message for a protected system folder is different from an error on every document you need. Once you have preserved the contents and confirmed the working folder path, try opening Command Prompt with Run as administrator and repeat the command. If your own folders still refuse access, keep the preserved copy and use the recovery route below; changing ownership or running filesystem repair on the original adds another problem to solve.
File not found: check the working folder path and the command's final \*.*. If the command points to the correct folder but the original folders remain absent, they may have been moved or deleted. Repeating attrib will not recreate them. Check antivirus history before treating them as deleted files.
Remove the infection from the computer
Shortcuts that regenerate after cleanup suggest an infected computer is still writing them. With the USB copy preserved, open Windows Security, choose Virus & threat protection, then Scan options and Full scan. This scans the computer's files and programs. Follow the actions offered for detected threats; Microsoft's scan guidance also explains the offline scan for persistent infections.
Use Protection history to see what Defender quarantined or removed. A missing document may be listed there. Microsoft warns that restoring a quarantined threat puts it back on the device, so restore only an item you have established was wrongly detected. Avoid taking the cleaned stick back to a shared computer that keeps producing shortcuts.
Files still missing after unhiding
| What you find | What to do next |
|---|---|
| Folders return, but a document will not open | Check its file size and antivirus history. Attribute changes do not fix an empty or damaged document. |
| The drive was formatted before cleanup | Write nothing new to the stick. Use a drive image for a deleted-file scan and save results elsewhere. Formatting and subsequent writes affect what remains recoverable. |
| Files disappeared during antivirus cleanup | Compare Protection history with the preserved copy before attempting file recovery. |
| The drive asks to be formatted, reports zero capacity or disconnects | Cancel the format prompt. These symptoms need filesystem or hardware investigation. The unhide command cannot make unreadable storage work. |
Our deleted USB file guide covers that next step. If the stick cannot stay connected or report its capacity correctly, USB flash drive recovery starts with getting access to the storage before searching for files.
Get help with data recovery
Bring your device to our Lincroft lab during opening hours, or mail it in.
How to mail your deviceThe $100 diagnostic is non-refundable once diagnostics start, and donor drives or replacement parts you approve are non-refundable once ordered, even if recovery fails.
Published by MDrepairs
MDrepairs is a data recovery and electronics repair lab in Lincroft, New Jersey. Our founder and lead technician Joseph Montanti films real cases for our YouTube channel, showing tools, repair steps and recovery outcomes.
Keep reading
- USB “Device Descriptor Request Failed”: What It Means for a Flash Drive
- USB Says “Please Insert a Disk” or “No Media”: Can You Recover the Files?
- SD Card Write Protected? Fixes Beyond the Switch
