Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 972
user99545 Avatar asked Apr 27 '12 00:04

user99545


1 Answers

See here for MSDN documentation on shell links.

like image 91
Josh Gao Avatar answered Sep 23 '22 16:09

Josh Gao