Hello,
My question seens very simple: i want to write a function like
private string ResolveLink(string LinkFilePath) { ... }
that receives, for example, "c:\\myshortcut.lnk" and gives back the
shortcut's target path. Just the target's path.
Tks!
Paulo_Amaral - 11 Oct 2007 20:08 GMT
Found the solution:
Add the COM reference: Windows Script Host Object Model
Code:
using IWshRuntimeLibrary;
private string Resolve(string LnkFilePath)
{
WshShell shell = new WshShellClass();
IWshShortcut link = (IWshShortcut)shell.CreateShortcut(LnkFilePath);
return link.TargetPath;
}
> Hello,
>
[quoted text clipped - 4 lines]
>
> Tks!