user99545
user99545

Reputation: 1173

Windows (.lnk) shortcuts API?

Are there any functions that allow you to create shortcuts in Windows just like you can create symlinks in Linux? I'd preferably like to be able to edit things like the target and name instead of having to re-create a whole new shortcut every time I want to change something due to an update.

I tried opening a .lnk file in a text editor and it was a whole bunch of gobbelty gook. I wonder why it's half binary as shortcuts on Linux are like an .ini file, simple and easy to use. I am afraid that if I go romping though the data, I might upset some sort of checksum and the shortcut won't work so that is why I am wondering if there is a specific API that should be called to tinker with these objects.

Update: I have found a function to query shortcut data MsiGetShortcutTarget() http://msdn.microsoft.com/en-us/library/windows/desktop/aa370299(v=vs.85).aspx , but nothing yet on creating or modifying shortcuts.

Upvotes: 5

Views: 6219

Answers (1)

Josh Gao
Josh Gao

Reputation: 2564

See here for MSDN documentation on shell links.

Upvotes: 8

Related Questions