title: Get target of Windows .lnk shortcut using "Start in" directory
body: <p>I am trying to retrieve the target path of a Windows .lnk shortcut, but the "Target" is not an actual file path according to the .lnk file's properties:</p>
  
  <p><img src="https://i.stack.imgur.com/c5HD1.png" alt="enter image description here"></p>
  
  <p>I am using the IWshRuntimeLibrary and the shortcut object I am accessing is of type IWshShortcut:</p>
  
  <pre><code>WshShell shell = new WshShell();
  IWshShortcut link = (IWshShortcut)shell.CreateShortcut(lnkFileName);
  // This returns "C:\Windows\Installer\{F843C6A3-224D-4615-94F8-3C461BD9AEA0}\PaintShopProExeIcon.ico"
  var targetPath = link.TargetPath;
  // This is the same as the "Start in" value in the image above
  var workingDir = link.WorkingDirectory;
  </code></pre>
  
  <p>The TargetPath property of the "link" object is not the location of the actual .exe: "C:\Windows\Installer{F843C6A3-224D-4615-94F8-3C461BD9AEA0}\PaintShopProExeIcon.ico"</p>
  
  <p>I can get the WorkingDirectory property from this object, which seems to be the same as the "Start in" property of the shortcut as in the image above. My question is, <strong>how can I get the actual target path of the .exe file the shortcut would open, if TargetPath is not the actual .exe path</strong>? Where is this information?</p>
  
  <p>The actual target path in this example is "C:\Program Files (x86)\Jasc Software Inc\Paint Shop Pro 9\Paint Shop Pro 9.exe". How does the system know to open "Paint Shop Pro.exe" specifically?</p>