I need to extract the icon from a windows shortcut (.lnk) file (or find the icon file, if it’s just pointed to by the shortcut).
I’m not asking about extracting icons from exe’s, dll’s, etc. The shortcut in question is created when I run a installation program. And the icon displayed by the shortcut is not contained in the .exe that the shortcut points to. Presumably the icon is embedded in the .lnk file, or the .lnk file contains a pointer to where this icon lives. But none of the utilities I’ve found work address this — they all just go to the .exe.
Many thanks!
This thread provides interesting informations about the data contained in a .lnk file
The sSHGetFileInfoss function should be able to extract the icon file.
Documented here, and used for a lnk file:
From the first link, you could build such an utility in c#, where you would declare this function like:
You could also built an utility in autoit script language, where you would use that function declared like this: