LNK is a file extension used for a shortcut file that points to an executable file. It stands for LiNK file and acts as a direct link to an .exe file. This saves the users from navigating to the executable file, thus saving the time of the users. A Windows shortcut LNK file format is denoted by a curled arrow. In the below image, a LNK file of Mozilla Thunderbird is shown.
This article reflects LNK file structure and the properties associated with the file.
The LNK file consists of the MAC times (times which specify when an event took place) of the target. This includes the timestamp of the target when it was last opened, when the LNK file was created, the access time and the modification time.
The other metadata related to LNK file structure are:
For Windows platform, the signature is 0x4C (4C 00 00 00) at offset 0.
A LNK file consists of a number of sequence of structures that are in accordance with the ABNF rules.
SHELL_LINK = SHELL_LINK_HEADER [LINKTARGET_IDLIST] [LINKINFO]
[STRING_DATA] *EXTRA_DATA
The different sequences are described in detail as under:
The ShellLinkHeader structure comprises of information like identification, timestamps, and the flags that are used for signifying the presence of extra structures that include LinkTargetIDList, LinkInfo and StringData.
The LinkTargetIDList structure of Windows shortcut LNK file format is used for specifying the target of the link to which it belongs. This structure is specified by the HasLinkTargetIDList bit that is present in the ShellLinkHeader. It is made up of two parts:
The LinkInfo structure is used for specifying information in case the link target is not found in its original location. This includes the info about the volume on which the target exe file was stored, the drive letter that was mapped with it, and a UNC path, which was present when the file was created.
The StringData in LNK file structures are used for conveying information related to user interface and path identification. These structures are specified by the bits present in the ShellinkHeader.
The ExtraData comprises of structures that are used for conveying additional information about a [articular link target.
The concept of creating links for files and applications originally exists on Mac OS, LNK files are also used for Windows OS on a large level.