What is the internal structure of a Windows shortcut?

3 HDDs on one computer: 2 with Windows XP, 1 with Windows 7, sequentially load the operating system from each of them.

I found that some work shortcuts (not all) created in the first XP do not work in the second XP and Windows 7 (unavailable to view the object for the shortcut).

To understand why this doesn't work, I create the same shortcut in Windows 7 and open both of these shorcuts files in a hex editor.

I found that the structures are different, but I don't know how to compare them.

What is the internal structure of a Windows shortcut?

What are the start and end bytes of some useful blocks of label content?

+3


source to share


1 answer


The shortcut ( .lnk

) file format is a property of Ms and can be seen here .

However, to save you the trouble of reading the entire PDF file, one thing that is stored in the shortcut exactly (can be verified by searching the shortcut with a hex viewer) is the (full) target path that it links to (!! important: during its creation); so it's DriveLetter : \ the_full_path.

To clear up the confusion, I suggest playing with target shortcuts on the same disc.



So, when switching hard drives ( DriveLetter s - aka C:

indicates different things), let's say that you created a shortcut on one of them: C:\shortcut.lnk

( C:

- this is DriveLetter assigned to the hard drive that Windows boots on, call this HDD1) which indicates to a target file located on another hard drive (and partition, let this HDD2) (for example E:\target.txt

); when switching hard drives (creating the main boot disk HDD2), the DriveLetter parameter will change, so now HDD2 will be C:

HDD1 D:

. Things complicate things when putting in HDD3, etc.

As an answer to our question, files .lnk

don't work because their purpose is no longer present.

+2


source







All Articles