SUBMIT A FILE TYPE CONTACT US SUPPORT ABOUT US

What Is an LNK File? The Windows Shortcut With a Target and Arguments Inside

An LNK file is a Windows shortcut that points to files, folders or programs, so read it before you double click it. Jump to your question below, or work through it in order.

37 min read Updated October 2026 Checked against sources and tests

What Is an LNK File? A small Windows file that points to something else

Short answer

LNK files end in .lnk, and they are Windows shortcuts. Every one is a small binary file that points to files, folders or programs. Windows hides the ending, so most people never see it.

We read 552 public LNK files with five readers, and we damaged one LNK file in 65 ways. On 24 broken copies at least one reader printed other text and no message, and 2 copies passed all six checks.

To see the parts, go to the inside part. To check a file, follow the six steps. To judge risk, read the safety part.

LNK files end in .lnk, and they are Windows shortcuts. An LNK file is a small binary file that points to other files, folders or programs. Windows hides the ending, so most people never see it.

LNK is short for link. Microsoft’s shell link specification says Windows files with the LNK extension use one binary format. That format stores the information needed to reach another data object. Revision 10.0 is dated 21 November 2025.

Windows 95 introduced file shortcuts, also called shell links. Wikipedia on shortcuts says an LNK file stores a target path, the program parameters, a working directory, a comment and a hotkey. It can also have its own icon.

FileInfo lists the .lnk ending as a Windows shortcut from Microsoft. It says Windows does not show the ending, even when it shows other known endings. Wikipedia says the NeverShowExt registry option controls that.

The forensics wiki says Windows used LNK files from Windows 95 through Windows 10. PRONOM lists the format as Microsoft Windows Shortcut, also known as Microsoft Shell Link.

Where our LNK files come from

We built one small LNK file ourselves, so it has no private data. It has 763 bytes and points to notepad.exe in the Windows System32 folder. A Python script wrote it from the layout in the Microsoft specification.

The script uses the target list that pylnk3 wrote for the same path. We damaged that LNK file in 65 ways and kept the intact file as baseline.

We also read 553 public .lnk files from the test folder of the Lnk project by Eric Zimmerman, which uses the MIT license. 552 are LNK files from nine Windows versions. The 553rd is a Recycle Bin file that is in a folder named Bad, and it is not an LNK file.

LNK file facts at a glance

Quick facts about LNK files
Property Value
Meaning A Windows shortcut. It points to files, folders or programs.
Made by Windows. Microsoft documents the format in its shell link specification.
Format Binary, with the low byte first.
Start The bytes 4C 00 00 00, then the class ID 01 14 02 00 00 00 00 00 C0 00 00 00 00 00 00 46.
Standard Microsoft shell link specification, revision 10.0 of 21 November 2025. PRONOM lists the format as x-fmt/428.
Opens with Windows starts the target. FileInfo lists Flint LinkInfo, TZWorks lp and HxD as programs that read one.
Size in our set 226 to 2,741 bytes for the public files, with a median of 1,306 bytes.
Our tests 552 public LNK files, 1 LNK file damaged in 65 ways, five readers and an 89 line script.

Wrong page? Look at the EXE page for programs, the ICO page for icon files or the JNLP page for Java launch files.

What Is Inside an LNK File? Five parts in a fixed order, from a 76 byte header to the end mark

An LNK file has five parts in a fixed order. The 76 byte header comes first. The target list, LinkInfo, the text strings and the extra data blocks follow. The header flags say which of them exist.

The figure cuts our 763 byte LNK file into its parts. The numbers match the parts below. A reader goes through the file from the top, because every part starts where one before it ends.

A bar of 763 bytes cut into five numbered parts of one small Windows shortcut file. The 76 byte header comes first, then the target list of 245 bytes, LinkInfo of 80 bytes, five text strings of 246 bytes and the extra data blocks of 116 bytes.
Our small shortcut file, 763 bytes, cut into its five parts. The numbers match the parts explained below.

The header

The header always has 76 bytes. Microsoft’s header page fixes the header size at 0x4C and the class ID at 00021401-0000-0000-C000-000000000046. That is why every LNK file starts with the same 20 bytes.

Header flags say which other parts exist. A time of zero means the time is not set, and the file size field stores the low 32 bits of the target size. The three reserved fields must be zero.

The 76 header bytes of our LNK file
0000  4c 00 00 00 01 14 02 00 00 00 00 00 c0 00 00 00
0010  00 00 00 46 ff 00 00 00 20 00 00 00 80 52 2b 5b
0020  57 65 dd 01 80 52 2b 5b 57 65 dd 01 80 52 2b 5b
0030  57 65 dd 01 00 14 03 00 46 00 00 00 01 00 00 00
0040  4e 06 00 00 00 00 00 00 00 00 00 00
The header fields of our LNK file
Bytes Field Our value
0 to 3 HeaderSize 4C 00 00 00, which is 76
4 to 19 LinkCLSID The fixed class ID of a shell link
20 to 23 LinkFlags FF 00 00 00, so parts 2 to 4 exist, all five strings exist and the strings use Unicode
24 to 27 FileAttributes 20 00 00 00, the archive attribute
28 to 51 Three times Creation, access and write time, all set to one value
52 to 55 FileSize 201,728, the low 32 bits of the target size
56 to 59 IconIndex 70, the number of the icon in SHELL32.dll
60 to 63 ShowCommand 1, a normal window
64 to 65 HotKey 4E 06, which is N with the Ctrl and Alt keys
66 to 75 Reserved Ten bytes of zero

The target list

The target list is a chain of shell items. A 2 byte size comes first, then the items and then a 2 byte end mark of zero. Our list has 5 items that name Computer, C:, Windows, System32 and notepad.exe in that order.

The Microsoft example for C:\test\a.txt follows the same pattern with four items. The longest list in our 552 public files has 7 items. 324 of the 552 files have a list.

LinkInfo

LinkInfo names the drive and the local path. Our LinkInfo has 80 bytes and says C:\Windows\System32\notepad.exe. 260 of the 552 public files have LinkInfo.

The strings

Up to five strings follow. Every string starts with a 2 byte count of 2 byte units, so a Unicode string of 21 characters takes 42 bytes plus its count.

Our five strings are the description Open the weekly notes, a relative path, the working folder C:\Reports, the arguments C:\Reports\notes.txt and an icon path. The longest arguments in the public files have 122 characters.

Extra data blocks

Extra data is a series of blocks. Every block starts with its size and a signature. A size under 4 ends the series, and our file ends with four bytes of zero.

Our file has a Tracker block of 96 bytes and a special folder block of 16 bytes. The Tracker block names the computer that made the LNK file. All 334 Tracker blocks in the public files name a computer, and 18 different names appear.

The forensics wiki says these details can help tie a file to a system. The public files also have environment path blocks (376 files), property store blocks (286), special folder blocks (254), known folder blocks (127), icon path blocks (8) and console blocks (5).

523 of the 552 public files have at least one block.

We read this layout from one small file and 552 public files. The rules come from the Microsoft specification and from our tests. We found no Windows 11 LNK file in the public set, so we tested none.

Where Does an LNK File Keep Its Target? Three places, and most readers print only one of them

An LNK file can keep its target in three places. The target list is in 324 of 552 public files, LinkInfo in 260 and the environment block in 376. Three of the four readers that print a target use LinkInfo only.

The figure shows the three places and how our 552 public files combine them. It also shows how many files every reader printed a path for.

Three places where an LNK file can keep its target, with counts for 552 public shortcuts, and how many files every reader printed a target path for. The target list is in 324 files, LinkInfo in 260 and the environment block in 376. Three readers print a path for 260 files and pylnk3 prints one for 406.
An LNK file can keep its target in three places. Most readers print only the path from LinkInfo.

The three places

The target list names the target as a chain of shell items. LinkInfo stores the drive details and the local path. The environment block stores a path that can start with a variable, like %ProgramFiles(x86)%.

How the files mix them

187 of 552 files, 34 percent, keep the target in the environment block and nowhere else. 184 files use all three places. 76 use the list and LinkInfo, 59 use the list alone and 5 pair the list with the environment block.

41 files have no target in any of the three places. Their LNK files still start with a valid header, so a reader loads them and prints no path.

What the readers print

exiftool 12.76, lnkinfo 20181227 and LnkParse3 1.6.0 print a target path for 260 files. All 260 have LinkInfo. pylnk3 0.4.2 printed a path for 406 files, including all 187 files that keep the target only in the environment block.

No reader printed a path for 43 files. One public LNK file points to Windows Media Player. It has no target list and no LinkInfo, and its only target is %ProgramFiles(x86)%\Windows Media Player\wmplayer.exe in the environment block. Three readers printed no path for it.

A blank target in one reader does not mean a broken LNK file. Read the file with a second reader before you decide.

Want to see the first bytes of your own file? Go to the check script.

What Do 552 Public LNK Files Contain? Windows versions, flags, blocks and five readers

We read 552 public LNK files from nine Windows versions with five readers. File, exiftool, lnkinfo and LnkParse3 loaded all 552. pylnk3 failed on 105. A reader that fails does not prove an LNK file is bad.

The figure shows the files and readers. They come from the test folder of one project, so they show how public LNK files look. They do not stand for every LNK file on your computer.

552 public LNK files
9 Windows versions
523 with extra blocks
711 KB of data to read
Bars show 552 public shortcuts by Windows version and by extra data block, and how many shortcuts five readers and our script loaded. File, exiftool, lnkinfo and LnkParse3 loaded all 552, pylnk3 loaded 447 and our script flagged none.
552 public shortcuts and five readers. Only pylnk3 failed to load some of them.

Where the files come from

The test folder has 553 files, and all 553 are different by SHA256 hash. The sizes range from 226 to 2,741 bytes, with a median of 1,306 bytes and a total of 710,628 bytes.

By Windows version the folder has 70 LNK files from Windows XP, 59 from Windows 2003 and 134 from Windows Vista. It has 97 from Windows 7, 66 from Windows 8, 78 from Windows 2012 and 48 from Windows 10.

What the headers and flags show

All 552 LNK files have header size 0x4C, the right class ID and the Unicode flag. The show command is 1 in 550 files and 3 in 2 files. The hotkey is zero in all 552.

The three times are zero in 218 files, and the target size field is zero in 233. The specification says a time of zero means not set. Our copy with all three times zero (copy 9) loaded in every reader.

The flags show how the files were made. 468 LNK files have a description, 330 a relative path, 247 a working folder, 120 arguments and 349 an icon path. 324 have a target list and 260 have LinkInfo.

What the five readers did

file 5.45, exiftool 12.76, lnkinfo 20181227 and LnkParse3 1.6.0 loaded all 552 LNK files. pylnk3 0.4.2 failed on 105 of them. 96 stopped with a UnicodeDecodeError, 7 with an IndexError and 2 with a ValueError.

The file command named the Recycle Bin file as something other than an LNK file. Our script flagged that one file and none of the 552 LNK files, so it raised no false alarm on this set.

exiftool, lnkinfo and LnkParse3 printed the same description, working folder, arguments and icon path for 544 of the 552 LNK files. pylnk3 matched them where it loaded. The other 8 differ in one way. lnkinfo expands %SystemRoot% in the icon path, and the others print it as written.

On our own LNK file lnkinfo 20181227 printed a show command of 0x00031400 and a hotkey of 5120. Both are wrong, because the file says a show command of 1 and the keys N, Ctrl and Alt. We did not use those two fields.

Most targets are hard to see 187 files keep the target only in the environment block.
Zero times are common The three times are zero in 218 files.
Tracker blocks name computers All 334 Tracker blocks name one, and 18 different names appear.
Failures are not proof pylnk3 failed on 105 LNK files that four other readers loaded.

What the numbers do not show

We read the files with five readers and one script. We started no LNK file, so we cannot say whether any target still exists. The folder has no Windows 11 file, and all its files come from one project.

What Happens When an LNK File Is Damaged? 65 broken copies and 24 that fooled a reader

We damaged one LNK file in 65 ways and read every copy with six checks. At least one reader printed other text and no message on 24 copies. Two copies passed all six checks, and 13 of the 65 edits were harmless.

We changed one thing at a time and sorted 65 copies into eight groups. They cover the header, flags, target list, LinkInfo, strings, extra data, the entire file and random bytes. Copy numbers match the rows of the figure.

A grid of 65 copies of one small shortcut in eight groups, read by the file command, exiftool, lnkinfo, LnkParse3, pylnk3 and our own script. Cells show whether a reader stopped, warned, printed the same text or printed other text.
65 copies of one shortcut, read by six checks. Cells show what every check did with a copy.

Green means the same text as the intact file, or a flag on a damaged copy. Amber means other text and no message. Blue means a warning, and red means the reader stopped. We compared the description, the working folder, the arguments, the icon and the target text. We did not compare every byte.

The file command reads only the start

The file command named 42 of the 52 damaged copies as LNK files. It flagged 10. It also named the 40 byte cut (copy 1) and the 76 byte cut (copy 2) as LNK files, because the start of every file still looks right.

It flagged header size 0x4d, header size 0 and the changed class ID (copies 3, 4 and 5). It also flagged the empty file, 600 zero bytes, the plain text file, the byte order mark and the ZIP header (copies 52 to 55 and 57). Two random byte copies (62 and 63) made up the rest.

Four readers, four sets of rules

exiftool stopped on 10 damaged copies and loaded 42. It warned on 1 and printed no message on 41, and on 22 of those 41 it printed other text than the intact file.

LnkParse3 stopped on 10 copies and loaded 42. It printed a warning on 20 of them, and on 9 more it printed other text with no message.

lnkinfo and pylnk3 are the strict readers. Both stopped on 38 damaged copies. lnkinfo printed other text on 4 of the 14 it loaded, and pylnk3 did so on 3 of the 14 it loaded.

The readers do not agree. Only 6 damaged copies stopped all six checks. They are copies 4, 52, 53, 54, 57 and 63.

Damage that fools the readers

Copy 39 puts a NUL character inside the description. exiftool, lnkinfo and LnkParse3 printed only the word Open. pylnk3 printed the text with the NUL inside. None printed a message, and our script flagged it.

Copy 59 changed one random byte in LinkInfo. System32 became Systeh32 in the target path. exiftool, lnkinfo and LnkParse3 printed the wrong path and no message. pylnk3 printed the right path, because it read the target list.

On 9 damaged copies no reader stopped. They are copies 6, 22, 33, 34, 39, 49, 56, 59 and 60. Two of them (59 and 60) passed all six checks.

Copy 60 changed one byte in a size value inside a shell item. All four readers printed the same text as for the intact file. Copy 56 joined two LNK files, and every reader printed the first one and no message. Only our script flagged the extra bytes.

Copy 25 swaps the first two items of the target list. exiftool, lnkinfo and LnkParse3 printed the same text. pylnk3 stopped, and our script missed it.

Damage that no reader cares about

13 edits changed nothing a reader needs. Our script flagged none of them. A show command of 0x55 (copy 7), no hotkey (copy 8), a file size of 0xffffffff (copy 10) and an unused flag bit (copy 18) loaded everywhere.

The specification treats any show command other than 1, 3 or 7 as a normal window. That explains copy 7. Copies 9 and 11 changed the times, and pylnk3 stopped on the creation time of all ones (copy 11).

The readers raised false alarms on harmless copies. lnkinfo stopped on the empty description and the doubled Tracker block (copies 36 and 51). pylnk3 stopped on the creation time (copy 11), the list with only an end mark (copy 26) and the unknown block signature (copy 47).

Four reader outputs showed wrong text on harmless copies. exiftool dropped the working folder, the arguments and the icon from copy 36, which has an empty description. For the emoji in copy 41 exiftool printed question marks and lnkinfo printed another symbol. pylnk3 printed the ANSI strings of copy 42 as bytes.

Our script sees structure and misses meaning

Our script flagged 48 of the 52 damaged copies and none of the 13 harmless copies. It missed copies 25, 59, 60 and 61.

It reads the size of every shell item and not the order of the items, so it missed the swap in copy 25. It cannot see a misspelled path in copy 59 or a changed size value in copy 60. A script that reads bytes cannot know what the writer meant.

What the groups show

Results by group of damaged LNK files
Group What we found
A. Header (1 to 11) The 40 byte cut stopped all four readers. Copy 4, with a header size of 0, stopped all six checks. Five harmless edits loaded in all readers, except the creation time that stopped pylnk3.
B. Flags (12 to 18) Six edits stopped pylnk3 and our script flagged them all. exiftool printed other text when the LinkInfo, target list or icon flag was cleared. The unused bit changed nothing.
C. Target list (19 to 26) A wrong list size made exiftool print other text and stopped lnkinfo and pylnk3. A third item of size 0 (copy 22) passed all four readers, and pylnk3 printed other text. The swapped items (copy 25) gave the same text in three readers and stopped pylnk3.
D. LinkInfo (27 to 34) A wrong size or offset stopped lnkinfo. The lost NUL made three readers print a changed path. A drive type of 0xff passed all four readers, and only our script flagged it.
E. Strings (35 to 44) Wrong counts made exiftool print other text and stopped lnkinfo. The NUL character fooled all four readers. The harmless accents, CJK and emoji gave exiftool and lnkinfo other text.
F. Extra data (45 to 51) A wrong Tracker size stopped lnkinfo and pylnk3. The removed end mark stopped pylnk3 only. The 64 extra bytes passed all four readers, and only our script flagged them.
G. Entire file (52 to 57) The empty file, 600 zero bytes, plain text and the ZIP header stopped all six checks. Two joined LNK files (copy 56) loaded as the first one in every reader.
H. Random bytes (58 to 65) Copies 59 and 60 passed all six checks. Copy 59 gave a wrong path in three readers. Copies 62 and 63 stopped at least five checks, and our script missed copy 61.

Read the grid with care. Green cells mean the same text as the intact file. We started no LNK file and compared no timestamps. A forensic tool can check more or less. Every test changed one thing in one small file.

What Does Our Expert Say About LNK Files? A note from Neeraj Singh on reading a shortcut before you open it

Read an LNK file before you open it, and keep the original. An LNK file stores a target and its arguments, so a double click starts whatever the file names. Our test shows 24 broken copies where a reader printed other text and no message.

Neeraj Singh

Expert insight

An LNK file looks small and harmless, but a double click starts a program with the arguments written inside. In our test four readers printed wrong text from broken copies and said nothing. Read an LNK file before you open it, and keep the original.

Neeraj Singh Manager, Tech Support & Operations 19+ years fixing Windows and system errors

Why a small file gets less care

People treat an LNK file as a link and not as a file. It is a file with a target, arguments and a working folder inside. A double click starts the target with those arguments.

The readers add a second risk. Four readers printed other text from broken copies and gave no message. A report from one reader can show wrong text. Read the file with two readers, and add a script that checks the structure.

Keep the original. Copy the LNK file before you edit it, and write down its SHA256 hash. The hash shows which file you received and whether a later copy differs.

How Do You Open an LNK File? A double click starts the target, so read the file first

A double click on an LNK file starts its target. To read an LNK file without starting anything, use a reader like exiftool or lnkinfo. You can also look at the bytes in a hex editor. Read what the file points to before you double click it.

We tested the readers on Linux. We read the pages of the Windows programs below and installed none of them.

A double click starts the target

A double click on an LNK file starts the target with the arguments stored inside. Wikipedia says an LNK file stores a target path, the program parameters and a working directory. We started no LNK file, because we worked on Linux.

Windows hides the .lnk ending, so an LNK file can look like the program it points to. The Register report describes the Target field in the Properties window of an LNK file. Read that field before you open an LNK file from someone else.

Read it without starting it

Five readers print what an LNK file stores and start nothing. The file command prints a short summary. exiftool 12.76 prints the strings, the drive details and the target path. lnkinfo 20181227 from the liblnk tools prints a long report. LnkParse3 1.6.0 and pylnk3 0.4.2 are Python libraries.

Six commands that read an LNK file and start nothing
sha256sum shortcut.lnk
head -c 20 shortcut.lnk | xxd
file shortcut.lnk
exiftool shortcut.lnk
lnkinfo shortcut.lnk
python3 lnk_peek.py shortcut.lnk

exiftool printed the lines below for our intact LNK file. Every line matches what we wrote into the file. The machine ID is a made up name, because we wrote the Tracker block ourselves.

Part of the exiftool output for our LNK file
Target File Size       : 201728
Icon Index             : 70
Drive Type             : Fixed Disk
Drive Serial Number    : 1CE0-F1A7
Volume Label           : OS
Local Base Path        : C:\Windows\System32\notepad.exe
Description            : Open the weekly notes
Relative Path          : ..\..\Windows\System32\notepad.exe
Working Directory      : C:\Reports
Command Line Arguments : C:\Reports\notes.txt
Icon File Name         : %SystemRoot%\system32\SHELL32.dll
Machine ID             : DESKTOP-ABC

In a hex editor

FileInfo lists HxD, Flint LinkInfo and TZWorks lp as programs that read LNK files. We installed none of them. A hex editor shows the first bytes, and the first four bytes of every LNK file in our public set are 4C 00 00 00.

The first 20 bytes of our LNK file
00000000: 4c00 0000 0114 0200 0000 0000 c000 0000  L...............
00000010: 0000 0046                                ...F

The first line has the header size, then the start of the class ID. The head -c 20 command and xxd work on any Linux or macOS computer.

On a Mac or on Linux

A Windows shortcut does not start a program on a Mac or on Linux by itself. FileInfo lists CrossOver and Parallels Desktop as ways to use Windows files on a Mac, and CrossOver on Linux. It lists TZWorks lp as a reader for Windows, Mac and Linux.

All five of our readers worked on Linux with free tools, and none needed Windows. Our EXE file guide explains the programs that many LNK files point to, and our ICO file guide explains the icons they name.

How the checks did on our 52 damaged copies

How every check did on our 52 damaged LNK files
Check Result
file 5.45 Named 42 copies as LNK files and flagged 10. It looks at the start of the file only.
exiftool 12.76 Stopped on 10 copies and warned on 1. It printed other text with no message on 22.
lnkinfo 20181227 Stopped on 38 copies and printed other text on 4. It stopped on 2 of the 13 harmless copies.
LnkParse3 1.6.0 Stopped on 10 copies and warned on 20. It printed other text with no message on 9.
pylnk3 0.4.2 Stopped on 38 copies and printed other text on 3. It stopped on 3 of the 13 harmless copies.
Our script Flagged 48 of the 52 damaged copies and none of the 13 harmless ones.

How Do You Check an LNK File? Six steps, and an 89 line script

Check an LNK file in six steps. Hash it, read its first bytes, name its type and use our script that checks the structure. Then read the target and the arguments with two readers. No check proves that the target is safe.

The six steps

  1. Copy the LNK file, write down its SHA256 hash and work on the copy.
  2. Read the first 20 bytes with head -c 20 file.lnk | xxd. An LNK file starts with 4c00 0000 0114 0200.
  3. Name the type with file file.lnk. You want a line that starts with MS Windows shortcut.
  4. Use the script below. It reads every part and names the faults it can see.
  5. Read the target, arguments and working folder with exiftool. Compare them with a second reader like LnkParse3.
  6. Stop if the target looks blank, the arguments are long or the program is unknown to you. Ask the sender before you open the LNK file.

The 89 line script that reads LNK files

The Python script below does steps 2 to 4. It reads the header, target list, LinkInfo, strings and extra blocks. It names every fault it finds. It changes no file and starts nothing.

It checks the header size, class ID, reserved fields and flags. It walks the target list item by item, then checks the LinkInfo size, its offsets and its drive type. It reads the five strings, walks the extra blocks and flags bytes after the end mark.

lnk_peek.py
#!/usr/bin/env python3
"""lnk_peek.py: read a Windows shortcut file and report faults. It changes nothing and starts nothing."""
import struct, sys

CLSID = bytes.fromhex('0114020000000000c000000000000046')
BITS = ['HasLinkTargetIDList', 'HasLinkInfo', 'HasName', 'HasRelativePath', 'HasWorkingDir', 'HasArguments', 'HasIconLocation', 'IsUnicode']
STRINGS = ['name', 'relative path', 'working directory', 'arguments', 'icon location']
BLOCKS = {0xA0000001: (0x314, 'EnvironmentVariable'), 0xA0000002: (0xCC, 'Console'), 0xA0000003: (0x60, 'Tracker'),
          0xA0000004: (0x0C, 'ConsoleFE'), 0xA0000005: (0x10, 'SpecialFolder'), 0xA0000006: (0x314, 'Darwin'),
          0xA0000007: (0x314, 'IconEnvironment'), 0xA0000008: (0, 'Shim'), 0xA0000009: (0, 'PropertyStore'),
          0xA000000B: (0x1C, 'KnownFolder'), 0xA000000C: (0, 'VistaAndAboveIDList')}


def peek(path):
    raw = open(path, 'rb').read()
    out = dict(items=0, info=False, strings={}, blocks=[], size=len(raw), errors=[])
    err = lambda m: out['errors'].append(m)
    if len(raw) < 76:
        err(f'only {len(raw)} bytes, the header alone needs 76')
        return out
    hsize, clsid, flags, attrs = struct.unpack_from('<I16sII', raw, 0)
    show, hotkey, r1, r2, r3 = struct.unpack_from('<IHHII', raw, 60)
    if hsize != 0x4C: err(f'header size is {hsize:#x}, it must be 0x4c')
    if clsid != CLSID: err('class ID is not 00021401-0000-0000-C000-000000000046')
    if r1 or r2 or r3: err('reserved fields are not zero')
    unicode = bool(flags >> 7 & 1)
    if flags >> 8 & 1 and flags >> 1 & 1: err('ForceNoLinkInfo and HasLinkInfo are both set')
    pos = 76
    if flags & 1:
        if pos + 2 > len(raw): err('no room for the target list size'); return out
        size = struct.unpack_from('<H', raw, pos)[0]
        end = pos + 2 + size
        if end > len(raw): err(f'target list says {size} bytes but only {len(raw) - pos - 2} remain'); return out
        p = pos + 2
        while p + 2 <= end:
            n = struct.unpack_from('<H', raw, p)[0]
            if n == 0: break
            if n < 3 or p + n > end: err(f'target item {out["items"] + 1} has size {n} that breaks the list'); break
            out['items'] += 1
            p += n
        else:
            err('target list has no terminator')
        if p + 2 != end and not out['errors']: err(f'target list ends {end - p - 2} bytes after its terminator')
        pos = end
    if flags >> 1 & 1:
        if pos + 28 > len(raw): err('no room for the LinkInfo header'); return out
        size, head, lflags, vol, base, net, suffix = struct.unpack_from('<IIIIIII', raw, pos)
        if size < 28 or pos + size > len(raw): err(f'LinkInfo size {size} does not fit the file'); return out
        out['info'] = True
        if head not in (0x1C, 0x24) and head < 0x24: err(f'LinkInfo header size {head:#x} is not 0x1c or 0x24 or more')
        for nm, off in (('volume', vol), ('local path', base), ('suffix', suffix)):
            if off and off >= size: err(f'LinkInfo {nm} offset {off} is outside its {size} bytes')
        if lflags & 1 and not 0 < base < size: err('LinkInfo says a local path exists but has no valid offset')
        if not lflags & 1 and base: err('LinkInfo has a local path offset but no local path flag')
        if lflags & 1 and 0 < base < size and 0 < suffix <= size and raw[pos + suffix - 1] != 0: err('local path does not end with a NUL')
        if lflags & 1 and vol + 8 <= size and struct.unpack_from('<I', raw, pos + vol + 4)[0] > 6: err('drive type is not 0 to 6')
        pos += size
    for i, nm in enumerate(STRINGS):
        if not flags >> (2 + i) & 1: continue
        if pos + 2 > len(raw): err(f'no room for the {nm} length'); return out
        n = struct.unpack_from('<H', raw, pos)[0]
        w = 2 if unicode else 1
        if pos + 2 + n * w > len(raw): err(f'{nm} says {n} characters but the file ends first'); return out
        s = raw[pos + 2: pos + 2 + n * w].decode('utf-16-le' if unicode else 'latin-1', 'replace')
        if '\x00' in s: err(f'{nm} has a NUL character')
        out['strings'][nm] = s
        pos += 2 + n * w
    while True:
        if pos + 4 > len(raw): err('extra data has no terminal block'); break
        n = struct.unpack_from('<I', raw, pos)[0]
        if n < 4: pos += 4; break
        if n < 8 or pos + n > len(raw): err(f'extra block at {pos} has size {n} that does not fit'); break
        sig = struct.unpack_from('<I', raw, pos + 4)[0]
        name = BLOCKS.get(sig, (0, ''))
        if name[0] and n != name[0]: err(f'{name[1]} block has size {n}, it must be {name[0]:#x}')
        out['blocks'].append(name[1] or hex(sig))
        pos += n
    if pos < len(raw): err(f'{len(raw) - pos} bytes follow the terminal block')
    return out


if __name__ == '__main__':
    r = peek(sys.argv[1])
    print(sys.argv[1])
    print(f"  {r['size']} bytes  target items {r['items']}  LinkInfo {'yes' if r['info'] else 'no'}  strings {len(r['strings'])}  extra blocks {len(r['blocks'])}")
    for k, v in r['strings'].items(): print(f'  {k}: {v[:70]}')
    for e in r['errors'][:12]: print('  PROBLEM', e)
    print('  ' + (f"{len(r['errors'])} problem(s) found" if r['errors'] else 'no problem found'))
    sys.exit(1 if r['errors'] else 0)

On our intact LNK file it finds 5 target items, LinkInfo, 5 strings and 2 extra blocks. It reports no problem. It read all 553 public files in under a tenth of a second and flagged one, the Recycle Bin file. On damaged copies it names the fault.

The script on our intact LNK file
python3 lnk_peek.py shortcut.lnk
  763 bytes  target items 5  LinkInfo yes  strings 5  extra blocks 2
  name: Open the weekly notes
  relative path: ..\..\Windows\System32\notepad.exe
  working directory: C:\Reports
  arguments: C:\Reports\notes.txt
  icon location: %SystemRoot%\system32\SHELL32.dll
  no problem found
The script on four damaged copies
python3 lnk_peek.py copy-4.lnk
  763 bytes  target items 5  LinkInfo yes  strings 5  extra blocks 2
  name: Open the weekly notes
  relative path: ..\..\Windows\System32\notepad.exe
  working directory: C:\Reports
  arguments: C:\Reports\notes.txt
  icon location: %SystemRoot%\system32\SHELL32.dll
  PROBLEM header size is 0x0, it must be 0x4c
  1 problem(s) found

python3 lnk_peek.py copy-14.lnk
  763 bytes  target items 0  LinkInfo no  strings 0  extra blocks 0
  PROBLEM LinkInfo size 1310963 does not fit the file
  1 problem(s) found

python3 lnk_peek.py copy-28.lnk
  763 bytes  target items 5  LinkInfo no  strings 0  extra blocks 0
  PROBLEM LinkInfo size 10 does not fit the file
  1 problem(s) found

python3 lnk_peek.py copy-49.lnk
  827 bytes  target items 5  LinkInfo yes  strings 5  extra blocks 2
  name: Open the weekly notes
  relative path: ..\..\Windows\System32\notepad.exe
  working directory: C:\Reports
  arguments: C:\Reports\notes.txt
  icon location: %SystemRoot%\system32\SHELL32.dll
  PROBLEM 64 bytes follow the terminal block
  1 problem(s) found

Copy 14 shows how one wrong flag moves everything. We cleared the target list flag, so the script read that list as LinkInfo and said the size does not fit the file.

The script on a plain text file with the .lnk ending
python3 lnk_peek.py copy-54.lnk
  24 bytes  target items 0  LinkInfo no  strings 0  extra blocks 0
  PROBLEM only 24 bytes, the header alone needs 76
  1 problem(s) found

What the script cannot see

The script reads structure and not meaning. It printed no problem for copy 25, where two shell items swap places. It also stayed quiet on copy 59, where System32 became Systeh32. It missed copy 60 too, where one size value changed.

The script on a copy with two swapped items
python3 lnk_peek.py copy-25.lnk
  763 bytes  target items 5  LinkInfo yes  strings 5  extra blocks 2
  name: Open the weekly notes
  relative path: ..\..\Windows\System32\notepad.exe
  working directory: C:\Reports
  arguments: C:\Reports\notes.txt
  icon location: %SystemRoot%\system32\SHELL32.dll
  no problem found

The script never checks that the target exists, and it never judges what the target does. An LNK file that passes can still point to a harmful program. We wrote the script from our 65 copies and 552 public files, so it knows the faults we tested and no others.

Want the causes of an error? Go to the causes.

Is an LNK File Safe to Open and Share? Opening starts the target, and sharing shows the computer name

An LNK file is safe to read and not safe to double click when you do not know its target. A double click starts the target with its arguments. Sharing an LNK file also shares the computer name stored in its Tracker block.

Reading an LNK file with a script or a reader starts nothing. The risk is what the LNK file starts and what it shows others about your computer. We scanned no file for malware and started no public LNK file, so we cannot say what any of them starts.

What opening does

The Register reported on 4 December 2025 that attackers hid harmful command line arguments in LNK files. They padded the arguments with white space or characters that do not print, so the Target field in Properties looked blank or ended in a harmless program. The article tracks the flaw as CVE-2025-9491.

Microsoft first called the flaw low severity, and its 31 October advisory said the case did not meet the bar for a vulnerability. The article says Microsoft made a silent change in the November 2025 update, and that Properties now shows the full command according to 0patch. We could not confirm that change.

Trend Micro reported nearly a thousand malicious LNK samples that date back to 2017. An LNK file from an unknown sender deserves the same care as an EXE file.

What an LNK file leaks

The computer name All 334 Tracker blocks in our public files name the computer that made the LNK file.
Folder and file names The target, the working folder and the arguments can name user folders and documents.
Times The forensics wiki says an LNK file stores the target times from before the last open.
Drive details The forensics wiki lists the volume serial number and the network share name.

An LNK file can outlive its target

PRONOM says an LNK file stores the file attributes and times apart from the target, so it can keep a record of a file after someone deletes the file. When the record matters, treat the LNK file as evidence and keep it.

Before you share an LNK file

  1. Open the file in a reader and read the target, arguments and working folder.
  2. Look at the Tracker block and the paths for computer names and user names.
  3. Send the target or a short instruction, not the LNK file, when the other side can make its own.
  4. Do not forward an LNK file from an unknown sender. Read it first.
  5. Hash the file and send the hash on another channel, so the other side can check it.

Use a copy. Work on copies of LNK files, and write down their SHA256 hashes. Keep the original read only, so no tool can change it.

Why Will Your LNK File Not Work? Eight causes, and what to do about every one

LNK files fail for eight reasons. The file can be another kind or cut short. The header, a flag, the target list, LinkInfo or a string can be wrong. The target can be gone, and the reader can be the problem.

The table lists what we saw in our 65 copies and what the readers said. We tested five readers on Linux. Read every fix as the first step and not the final answer.

Eight causes of LNK files that will not work
Cause Details and fix
You have a different kind of file A file with the .lnk ending can be plain text (copy 54), a ZIP archive (copy 57) or an empty file (copy 52). All six checks flagged those three. The one Recycle Bin file in the public set starts with 02 00 00 00. Fix: Read the first bytes. An LNK file starts with 4c00 0000.
The file is cut short A cut to 40 bytes (copy 1) stopped all four readers. A cut to the 76 byte header (copy 2) stopped three, and exiftool printed other text. The smallest public LNK file has 226 bytes. Fix: Compare the size and the hash with the source, and copy the file again.
The header is damaged A header size of 0x4d (copy 3) fooled exiftool, which printed other text. A header size of 0 (copy 4) and a changed class ID (copy 5) stopped exiftool, lnkinfo and pylnk3. Fix: Copy the file again. The header must start with 4c00 0000 and the class ID.
A flag says the wrong thing A cleared LinkInfo or target list flag (copies 13 and 14) changed the exiftool text and stopped lnkinfo and pylnk3. A cleared Unicode flag (copy 12) stopped both of them too. Fix: Compare the flags with the parts our script finds.
The target list is wrong A list size of 1000, 0 or 2 (copies 19 to 21) changed the exiftool text and stopped lnkinfo and pylnk3. Fix: Read the file with our script, which names the size that does not fit.
LinkInfo is wrong A wrong LinkInfo size (copies 27 and 28) changed the exiftool text and stopped lnkinfo and pylnk3. A lost NUL (copy 33) gave a changed path in three readers with no message. Fix: Check the path in two readers.
A string is wrong A wrong string count (copies 35, 37 and 38) and a cut string (copies 43 and 44) changed the exiftool text and stopped lnkinfo and pylnk3. A NUL character (copy 39) fooled all four readers. Fix: Read the strings with the script and with two readers.
The target is gone or the reader is limited An LNK file can be fine while its target is gone. Our script reads the LNK file and never the target, and we did not test missing targets. Wikipedia says Distributed Link Tracking can update an LNK file when the target moves to another drive. pylnk3 failed on 105 public LNK files that four other readers loaded. Fix: Try a second reader, and look for the target at the path the LNK file names.

Fix an LNK file in seven steps

  1. Copy the LNK file, write down its SHA256 hash and work on the copy.
  2. Read the first bytes and name the type. An LNK file starts with 4c00 0000.
  3. Compare the size with the source. The smallest public LNK file has 226 bytes, so a file of a few dozen bytes is cut.
  4. Read the file with the check script, and note every fault it names.
  5. Read the file with a second reader like exiftool or LnkParse3. When two readers print different text, trust neither.
  6. Look for the target at the path the LNK file names. An LNK file can load in a reader and still point to nothing.
  7. If the file is damaged, copy it again from its source and compare the hashes. If you cannot, make a new LNK file.

We did not test repairs on files from other people. An LNK file that passes our script can still fail on Windows, and an LNK file that fails in the script can still start. Only Windows knows what it accepts.

What to send when you ask for help

If a forum or a support team asks about your LNK file, send these lines. They show what the file is and where the readers stopped, and they save rounds of questions.

A message that gets an answer
Subject: LNK file will not open
File: name, size in bytes and SHA256 hash
First bytes: the output of head -c 20 file.lnk | xxd
Type: the output of file file.lnk
Script: the output of lnk_peek.py
Readers: the output of exiftool and lnkinfo
Windows: the version and the program that made the LNK file
History: where the file came from and what changed

Not an error, but a question about similar files? Go to the versus part.

How Do You Convert an LNK File? To text, to JSON or to a new shortcut

You cannot convert an LNK file to a program, because an LNK file only names its target. You can convert one to text or JSON with exiftool or LnkParse3, and you can write a new LNK file with pylnk3. A converter reads the file and writes a new one, and the original stays unchanged.

This part reports what we tested on Linux. We started no LNK file and opened none on Windows.

To text and JSON

exiftool 12.76 printed 32 fields for our LNK file, and its -json option writes them as JSON. LnkParse3 writes JSON with its -j option, in six groups named data, extra, header, link_info, size and target.

Two commands that convert an LNK file to JSON
exiftool -json shortcut.lnk > shortcut.json
lnkparse -j shortcut.lnk > shortcut-lnkparse.json

Both leave the original unchanged. We compared the five strings and target path in the output with what we wrote into the file, and all of them matched.

To a new LNK file

pylnk3 0.4.2 wrote a new LNK file for notepad.exe in 419 bytes. We gave it a description, working folder and arguments. exiftool read the three strings back and our script found no problem.

Three lines of Python that write an LNK file
import pylnk3
pylnk3.for_file(r"C:\Windows\System32\notepad.exe", "new.lnk",
    description="Made by pylnk3", work_dir=r"C:\Reports", arguments=r"C:\Reports\notes.txt")

The new file has no LinkInfo, so exiftool printed no local path for it. We did not open it on Windows.

What you cannot convert

An LNK file stores no program code. A shortcut to notepad.exe names the program and does not contain it, so a conversion to an EXE file has nothing to convert. Copy the target when you want the program.

Conversions and how much we know
Task What we know
LNK to text or JSON Tested with exiftool and LnkParse3 on our LNK file. The strings matched.
New LNK from a path Tested with pylnk3 on Linux. exiftool read the strings back. Not opened on Windows.
LNK to URL Not tested. Wikipedia says URL files are shortcuts to remote resources.
LNK to EXE Not possible. An LNK file names its target and does not contain it.

How Does an LNK File Differ From URL, EXE and Symbolic Link Files? A shortcut, a web link, a program and a file system link

An LNK file points to a target on your computer, and a URL file points to a remote resource. An EXE file is the program itself. A symbolic link works in the file system, and an LNK file works through Explorer.

People mix these types up because all of them open something else. Windows can draw a small arrow over a shortcut icon, and Wikipedia says the IsShortcut registry option controls it. The arrow marks an LNK file and not the program.

LNK files next to similar files
Type What it is
LNK Binary. A Windows shortcut to files, folders or programs. Microsoft documents it as a shell link.
URL A Windows shortcut to a remote resource, like a web page, says Wikipedia. We read none.
EXE The program itself. Our guide to EXE programs covers it, and an LNK file only names it.
Symbolic link Wikipedia says a symbolic link is a file system feature and an LNK file is an Explorer feature. A program needs shell support to follow an LNK file.
macOS alias Wikipedia says the alias type started in System 7 and tracks details like the inode number. The Finder supports it, and Unix commands do not.
Desktop entry Linux desktops use .desktop files that follow the freedesktop.org desktop entry specification, says Wikipedia.

Other files also start things. JNLP files launch Java programs, and our JNLP file guide explains them. An LNK file can name an icon, and our guide to ICO icons covers that format.

What Is the LNK File Format Made Of? The facts we could check, and where they came from

An LNK file is a binary file with a 76 byte header followed by up to four more parts. The header flags say which parts exist. The facts below come from Microsoft, Wikipedia, PRONOM, the forensics wiki, FileInfo and our checks of 552 public LNK files and 65 damaged copies.

Facts about the LNK file format
Part What we checked
Name Shell Link, a binary format that Microsoft documents. Files end in .lnk. (Microsoft)
Revision 10.0, dated 21 November 2025. The previous version is 9.0, dated 10 June 2025. (Microsoft)
Origin Windows 95 introduced file shortcuts, also called shell links. (Wikipedia)
Header 76 bytes. Header size 0x4C and class ID 00021401-0000-0000-C000-000000000046. (Microsoft)
Times A FILETIME of zero means not set. (Microsoft)
Show command The values 1, 3 and 7 are defined. Any other value is treated as a normal window. (Microsoft, our copy 7)
Reserved fields Three fields that must be zero. Copy 6 set one to 1. LnkParse3 warned and three readers printed the same text. (Microsoft, our copy)
Parts Header, target list, LinkInfo, strings and extra data. The header flags say which parts exist. (Microsoft example, our file)
Strings A 2 byte count comes before every string. The count is in 2 byte units. (Microsoft example, our file)
Extra data Blocks with a size and a signature. A block size under 4 ends the list. The Tracker block has 96 bytes. (Microsoft example, our file)
Signature The bytes 4C 00 00 00 and the class ID. PRONOM lists the 20 bytes at offset 0. (PRONOM)
Windows versions Windows 95 to Windows 10, says the forensics wiki. Our public set covers nine versions from Windows XP to Windows 10.
Jump Lists The same binary format appears in numbered streams inside Jump List files on Windows 7 and later. (forensics wiki)
Hidden ending Windows hides .lnk, and the NeverShowExt registry option controls it. (FileInfo, Wikipedia)
Link tracking On NTFS systems the LNK file stores the target ID, so Distributed Link Tracking can update it when the target moves to another drive. (Wikipedia)
Our counts 552 public LNK files, 65 copies of one LNK file, five readers and an 89 line script.

About the values we list

Rules about the format come from three Microsoft pages and from our tests. Counts come from our own files. FileInfo and Wikipedia are directories, so we use them for names, history and programs.

We read the Microsoft overview, header and example pages. We did not read the full specification document, because our tools could not open it. Every rule on this page names its source.

What we left out

We damaged one small LNK file that has a target list, LinkInfo, five strings and two extra blocks. Shortcuts with other parts can react in other ways. We did not damage a Jump List stream or a URL file.

We started no LNK file and tested no Windows program. We compared strings and target text and not timestamps. We tested five readers on Linux, so Windows programs can behave in other ways.

The public set has no Windows 11 LNK file, and its 552 files come from one project. The Recycle Bin file in that set is not an LNK file, so we left it out of every count of LNK files.

Sources checked

For the format, see Microsoft’s MS-SHLLINK specification, the header page and the worked example. For history and similar files, see Wikipedia’s Shortcut article.

For forensics and file records, see the PRONOM record, the forensics wiki page on LNK files and the FileInfo page on LNK files. For the 2025 flaw, see The Register article. Every count came from files and scripts in our research folder.

Frequently Asked Questions About LNK Files

What is an LNK file?

An LNK file is a Windows shortcut. It is a small binary file that points to other files, folders or programs. Microsoft documents the format as a shell link. Windows hides the .lnk ending, so most people see only the icon.

How do I open an LNK file?

Double click it, and Windows starts the target. To read it without starting anything, use exiftool, lnkinfo or LnkParse3. You can also look at the bytes in a hex editor. Read the target and the arguments before you double click an LNK file from someone else.

How do I see where an LNK file points?

Open its Properties window and read the Target field, or read the file with exiftool or lnkinfo. Three of our four readers print only the path in LinkInfo, and 187 of 552 public LNK files keep the target only in the environment block. Use a second reader when the first prints no path.

Is an LNK file a virus?

No. An LNK file is a format and not a virus, but attackers misuse it. The Register reported on 4 December 2025 that attackers hid harmful arguments in LNK files with white space. Trend Micro reported nearly a thousand malicious samples back to 2017. Do not open an LNK file from an unknown sender.

Why does my LNK file not work?

Eight causes cover what we found. The file can be another kind or cut short. The header, a flag, the target list, LinkInfo or a string can be wrong. The target can be gone, and the reader can fail. Try a second reader before you call the file bad.

How do I check an LNK file?

Hash it, read its first 20 bytes and name its type with the file command. Then use our 89 line script and read the target with two readers. Our script flagged 48 of 52 damaged copies and none of the 13 harmless ones.

Can I convert an LNK file to an EXE file?

No. An LNK file names its target and does not contain it. To get the program, copy the target. You can convert an LNK file to text or JSON with exiftool or LnkParse3, and you can write a new LNK file with pylnk3.

What is the difference between an LNK file and a URL file?

An LNK file points to files, folders or programs on a computer. Wikipedia says URL files are shortcuts to remote resources, like web pages. Both open something else, and they are separate formats.

Why does my LNK file show no target path?

Three readers print only the path from LinkInfo, and 260 of 552 public LNK files have it. 187 keep the target only in the environment block. pylnk3 printed a path for all 187. exiftool, lnkinfo and LnkParse3 printed none.

Does an LNK file store my computer name?

The Tracker block names the computer that made the LNK file. 334 of the 552 public LNK files have a Tracker block, and all 334 name a computer. Read the block before you share an LNK file.

Why does Windows hide the .lnk ending?

FileInfo says Windows does not show the .lnk ending, even when it shows other known endings. Wikipedia says the NeverShowExt registry option under HKEY_CLASSES_ROOT\lnkfile controls it. FileInfo calls the registry change not recommended and advises a backup first.

Can I edit an LNK file in a text editor?

No. An LNK file is binary, and text editors can break it. One wrong byte in a header flag or size field stopped readers on many of our damaged copies. Make a new LNK file with Windows or with a library like pylnk3, and keep the original.

Still Stuck With an LNK File? Two routes out, and where to look next

Your LNK file won’t work

Read the first bytes and follow the seven steps. The cause table lists what to try in order.

You do not know what it points to

Read the target part, and then start our script.

Is it a program? An EXE file is a program. Our page on EXE files covers it, and the versus part shows how the two differ.

Is it an icon? An ICO file stores icons. Our page on ICO files covers the format.

Is it a Java launch file? JNLP files start Java programs. Our page on JNLP files covers it.

Is the data unknown? Our page on DAT files covers files with no clear type, and the file extension resource library lists many more.

Is your type missing? Send it on the submit a file type page.