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

Latest Posts

Scripted WordPress to Hugo Migration

Scripted WordPress to Hugo Migration
After having published in WordPress for almost 20 years, it was time for a change. This site is now rendered by Hugo, a static website generator built for Markdown content hosted in a Git repository. The migration from WordPress (HTML) to Hugo (Markdown) was far from trivial. Since I couldn’t find any tool for the job, I developed my own set of migration scripts that fully automate the migration process. You can find them on GitHub along with extensive documentation.
Website