How to get the target path of a shortcut in windows scripting?
-
06-07-2019 - |
Question
From what I have read until now, you can get the TargetPath property of an objet of class Shortcut, which is the result of the method CreateShortcut of WScript.Shell.
But I have not found any way to get the target path of an existing shortcut.
Solution
In javascript:
var sh = WScript.CreateObject("WScript.Shell");
var sc = sh.CreateShortcut(shortcutPath);
var targePath = sc.TargetPath;
It took me some time to understand it. So I guess there will be at least one person happy to find the answer here.
OTHER TIPS
by using .path property?
http://www.bigresource.com/VB-Get-the-stored-path-from-a-shortcut--UWlkOW9XKz.html
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow