Resolving special .lnk (shortcut) files.


  •      The IE icon on Desktop (in my case XP), created by default, is a .lnk (shortcut) file. However, if you check its properties, unlike other shortcuts which show you the shortcut properties like Target, Start In etc., this file opens the Internet properties of the IE. Also, unlike other shortcuts, this file can not be copied/pasted. Also, this file is not listed when you do a Dir.

         My concern is how can I resolve a shortcut created from this file to the target exe (iexplorer.exe). The IShellLink Interface ( GetIDList() & SHGetPathFromIDList() ) wouldn't work as the shortcut points to the IE file on the Desktop and not the target exe. Also, the IshellLink::GetPath() wouldn't work as well as this is an MSI created file.

       This may be a very unique case, but is very important for the application I'm developing. Any cues would be highly appreciated.

    Thnx and Regards

    Thursday, July 02, 2009 8:54 PM

All replies

  • It is an advertised shortcut that points to a Windows Installer product and can trigger a repair if the product is damaged. Use MsiGetShortcutTarget and other Windows Installer APIs to get the shortcut target .
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful. This posting is provided "AS IS" with no warranties, and confers no rights.
    Visual C++ MVP
    Thursday, July 02, 2009 11:17 PM