A .lnk
file (created via the create shortcut
context menu in Windows Explorer) a symbolic link or a junction?
1 Answer
It is neither. Links and junctions are features of the file system, built into NTFS.
A .lnk is a feature of the "shell" - the desktop gui part of Windows. Effectively it is just a file that contains reference to another file (they can also point to any path that the shell knows how to open, including various URLs, or even pathless shell objects such as Computer or Control Panel folders or items contained there, or programs that aren't actually installed but "advertised" via Windows Installer).
It is the gui part of Windows that dereferences the link and opens the right file, whereas with a symbolic link or junction this is done by NTFS.
-
5Note that shell shortcuts do not necessarily refer to files; they can also point to any path that the shell knows how to open (including various URLs) or even pathless shell objects (Computer or Control Panel folders or items contained there), or programs that aren't actually installed but "advertised" via Windows Installer... Commented Jul 4, 2013 at 23:36
-
2A good way to confirm this answer is to drag a .lnk file into a text editor. You see the link file instead of the target file. Commented Jul 5, 2013 at 0:09
-
@ColeJohnson That is not a perfect solution as some text editors will attempt to follow links when it tries to open them. Commented Jul 9, 2013 at 4:26