Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1088
  • Last Modified:

LNK and Shortcut format

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.
  • 3
1 Solution
MorrisRAuthor Commented:
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.
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.

I posted a message at customer service to see if they can unaccept the question or get your points back.
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now