LNK and Shortcut format

Posted on 1998-12-02
Last Modified: 2012-06-27
Does anyone know the layout of a .LNK shortcut file? I need to know how to read the path, executable, default directory, title, icon location, etc. from the raw file. Hopefully a "C" structure format.
Question by:MorrisR
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3

Accepted Solution

scrapdog earned 100 total points
ID: 1254790

Author Comment

ID: 1254791
I already have the LNK.ZIP from that site. The example doesn't provide me with all the details of a LNK file. A LNK file is not that big. I can see the sections: comment, start directory, executable, path, volume label, parameters being passed, where the display icon come from, etc. However, I can see and understand these things visually because I know what I set them too - but I can not understand the pattern in which they are placed. I can see a DWORD for size and then a non null terminated text field. I need to decipher them programmatically.

Expert Comment

ID: 1254792
I can't really help you here.

But with there being a non-null terminated text field, I can infer that either the string is of fixed-length, or the size of the string is stored somewhere in the file (kind of like the way pascal strings are stored).

Your best bet is to run several LNK files thru a hex editor and see if this is a fixed length string.  If not, find out how long the text string is, then search for that byte that represents this length in the file.  If it is consistent, between files, chances are that this is the place where the length of the string is stored.

You probably would have been wise to reject the answer if it didn't work for you.  Now if anyone knows the answer, they will have to post it in the form of a comment, AND they will have to pay the 10 PAQ points to see the question.  So I suppose that you will have to post another question in order for others to see it.  

I will help you if I can.


Expert Comment

ID: 1254793
I posted a message at customer service to see if they can unaccept the question or get your points back.

Expert Comment

ID: 1254794
Thanks scrapdog for following up on this question.

I have added the points assigned to this question back to his account so he can post another question.

Linda Gardner
Customer Service @ Experts Exchange

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This tutorial is posted by Aaron Wojnowski, administrator at  To view more iPhone tutorials, visit This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question