How do I get the target path of a shortcut in Windows scripting?

From what I've read so far, you can get the TargetPath property of an object of the Shortcut class that is the result of the WScript.Shell CreateShortcut method.

But I haven't found a way to get the target path to the existing shortcut.

+2


source to share


2 answers


In javascript:

var sh = WScript.CreateObject("WScript.Shell");
var sc = sh.CreateShortcut(shortcutPath);
var targePath = sc.TargetPath;

      



It took me a while to figure this out. So I think that at least one person will be happy to find the answer here.

+5


source


using the .path property?



http://www.bigresource.com/VB-Get-the-stored-path-from-a-shortcut--UWlkOW9XKz.html

0


source







All Articles