How to retrive target file from a shorcut icon using C#

  • Thread starter Thread starter John
  • Start date Start date
J

John

How do I get the file path(target file) of a short-cut
icon if I'm writing my application in C#.
 
John,

You will want to take a look at the section of the MSDN documentation
titled "Shell Links", located at (watch for line wrap):

http://msdn.microsoft.com/library/d.../shell_int_programming/shortcuts/shortcut.asp

In it, there is a section titled "Using Shell Links". There is an
example in C++ that can be converted to .NET (using COM interop) which you
can use to resolve the path that a shell link points to.

Also, you should be able to set a reference to shell32.dll and use the
ShellLinkObject to do the same thing.

Hope this helps.
 
Back
Top