I just tested with Windows's .lnk
shortcut files, and the result is the same, courtesy of Windows Explorer:
- Right-clicking a shortcut to a directory, or a file with
NoOpenWith
registry value (such as an executable), doesn't even give you the "Open With..." option to try and open with a text editor. You still get "Send To..." though, which doesn't follow shortcuts.
- Right-clicking a shortcut to a file gives you "Open With...", but opens the pointed file (I've tested with a program of mine, it directly receives the target path).
- Notepad++'s "Edit with Notepad++" extension also opens the target.
- "Send To..." however, gives the program a path to the shortcut itself. So to look at the entrails of just any file, even if it's a shortcut, you can add a shortcut to your favorite text/hex/whatever editor in
C:\Users\<username>\AppData\Roaming\Microsoft\Windows\SendTo
.
- "Properties" will show you the target path, unless it's one of those "special" Windows Installer shortcuts.
Now for .url
"internet shortcut" files:
- Even with shift-right-click, I don't get a "Open With..." to check their entrails. This despite not having the
NoOpenWith
value (it does however have NeverShowExt
and IsShortcut
, as well as the FTA_Show
bit in EditFlags
; and I just found its shell\Open
key contains a value named LegacyDisable
whose meaning eludes me, but whose name is promising -- Edit: After checking this, I guess the Open I see in the context menu is actually provided by the context menu handler, and disabling the "open" verb removes "open with" as well)
- No Notepad++ either.
- "Properties" will show you the target URL.
- Good news is, it still has "Send To", which doesn't follow them either, so you can look at their entrails. And this time, they're actually text files:
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
IDList=
URL=http://go.microsoft.com/fwlink/p/?LinkId=255142
IconIndex=0
IconFile=%ProgramFiles%\Internet Explorer\Images\bing.ico
In fact, they're not that different from Linux's .desktop
files...
And regarding those, one question remains: Who does the actual fetching? It's possible the file explorer fetches the URL to a temporary file, and invokes the program on this, but it's more probable that it passes the URL as argument to the text editor, and the text editor fetches. This too could be easy to test: Just make your own program, that displays its arguments in a message box. And if your Linux's message boxes allow selecting & copying the text, then problem solved, you now have your GUI for retrieving the shortcut's URL.