Recently many of my friends came to me with a problem like suddenly my folders in pen drive/external hard drives turned as a shortcut [ink files] and unable to get back the original folders but the contents of the folders are available in the shortcuts. When this problem first I thought of the folders may be hidden, but even when we enabled show hidden files/folders it doesn’t show the folders. Then I worked on it for few hours and found some solution for it. I think many of you also faced this problem and I’m not sure about the virus behind this problem. Let me share the steps to recover your folder by using simple command prompt tricks. There is no need for the data recovery professional on this one.

Before I start, I have taken one of my friends affected hard drive with the above-stated problem.

How To Steps To Get Back Your folders which turned to ink files:

1. Connect your problem occurred pen drive/ external hard drives to your PC.

[How To] Get Back Your folders which turned to .lnk files (1)

2. Now open Command Prompt with Admin Controls.

[How To] Get Back Your folders which turned to .lnk files (2)

3. Now navigate to the infected drive.

4. Now type dir /w/a to display the list of files including hidden files/directory.

[How To] Get Back Your folders which turned to .lnk files (3)

5. Now from the list, you can see the original folders and the ink files for all the folders. But when tried opening your hard disk the original drives are not visible even though if you have enabled Show hidden Files/Folders

[How To] Get Back Your folders which turned to .lnk files (4)

6. Now to get back your original folders do the below commands for every folder you want to get back.


attrib -s -h “complete path of the folder”

E.g. : attrib -s -h “G:\Videos”

[How To] Get Back Your folders which turned to .lnk files (5)

By changing the folder names of every folder in the above command you can get back your original folders. After the original folders are visible in your explorer delete the .lnk [shortcut files] from your hard disk. Before that try to delete the unwanted files which may be a virus from the command prompt or using WinRAR.

Check out our Video tutorial for better understanding.

If this tutorial was helpful, kindly share and post your comments.

Related: How To Hide Folders completely even from Show Hidden Folders in Windows

  • Sivakarthikeyan

    Nice Guide… Thanks a lot. I retrieved my files using the steps. Thanks again Ashok.

  • Manikandan Uthaman

    Thanks a lot frnd… it was really useful

  • Aritra Sarkar


  • ash

    thnxz dude

  • Ganesh

    Excellent… Good Method.. I got data from .lnk file… Thanks a lot Ashok…

  • Anshuman Gaikwad


  • Ninad Chandoskar

    If you have multiple folders and files, use the following trick. Type in cmd –

    attrib -H -R -S /S /D X:*.*

    Where X is your USB drive letter.

    It will take few seconds. After that, delete .lnk files.

  • Dan Higgins

    attrib -s -h /s /d *.* This works for all files and folders missing or hidden

  • Paras Jain

    Just go to Explorer Options and uncheck the option saying ‘Hide protected operating systems files’. The .lnk virus scripts add these attributes to all your files thus rendering them off from the explorer’s normal view.