Sublime Forum

Opening shortcuts (.lnk files) by drag-and-drop opens the actual shortcut, not the linked file

#1

Hi, I’d like to be able to open some plain text files whose shortcuts I have on my desktop by dragging-and-dropping the shortcuts (.lnk files) to Sublime Text’s window. However, if we do this, instead we’ll see the hex data representing the actual shortcut (.lnk) file, not the linked file, which is the intended.

I tried adding the option "binary_file_patterns": ["*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"], to my user settings, then trying two approaches: 1. removing all the contents of the array (thus leaving it as []) and 2. adding the ".lnk" option. None worked.

I know this exact same question was asked by someone else 11 years ago, but still no clues; therefore I thought it would be best to ask again.

0 Likes

#2

https://packagecontrol.io/packages/FollowLnk
I am the plugin author btw.

1 Like

#3

Whoa, that seems to solve the problem! Congratualations, jfcherng!
However, it seems to work only with some file extensions. I have a .md somewhere on my PC and a .lnk to it on my Desktop; it openened the actual md file. But, when I tried doing the same with a .ahk (AutoHotKey script) file, it did nothing. In fact, it displayed the “Users” folder of my Windows OS.
What gives? Sublime Text build 4169 and Windows 10 build 19045.4046.

0 Likes

#4

I’ve just update my plugin. It should be available within hours.

- fix: improve parsing LNK for non-ansi target path
- refactor: replace `pylnk3` with `LnkParse3`
1 Like

#5

You did it! Now it’s working fine. Keep on bringing usefulness to the world! =D

1 Like