Shortcut Magic

Windows shortcuts aka LNK files have interesting capabilities. The shortcut target can be stored not only as a fixed-path string, but also as an item ID list. If a shortcut is equipped with such a list, it is - to a certain extent - platform-independent.

When the shortcut target is resolved, the current platform is taken into account and the resulting path is modified accordingly. Here is an example: Looking at the properties of the Internet Explorer shortcut in Start Menu on a German copy of Windows XP, you will notice that the target path points to something below “C:\Programme”:

Shortcuts - Windows XP IE link viewed from 32-bit process on German Windows XP

When you look at the properties of the same shortcut from 64-bit Explorer on Windows 7 x64 you see something entirely different:

Shortcuts - Windows XP IE link viewed from 64-bit process on Windows 7

The target path was auto-corrected from “C:\Programme” to “C:\Program Files”. And this goes event further: when viewed from a 32-bit process on Windows 7 x64 even different properties are displayed:

Shortcuts - Windows XP IE link viewed from 32-bit process on Windows 7

Now we have the 32-bit Program Files folder “C:\Program Files (x86)”.

Comments

Related Posts

Dissecting a Shortcut

Ever wondered about the layout of shortcut files? Those tiny little buggers with the extension LNK you have probably dozens of on your desktop? For years the format was subject to reverse engineering and speculation. Last year Microsoft finally released an official format specification, documenting this surprisingly complex format. This article is the result of analyzing a typical LNK file with the help of Microsoft’s documentation and information from other sources.
Windows Internals

Latest Posts