【问题标题】:How to get the target path of a shortcut in windows scripting?如何在 Windows 脚本中获取快捷方式的目标路径?
【发布时间】:2009-10-23 12:31:08
【问题描述】:

从我到现在的阅读中,你可以得到一个类 Shortcut 对象的 TargetPath 属性,它是 WScript.Shell 的 CreateShortcut 方法的结果。

但我还没有找到任何方法来获取现有快捷方式的目标路径。

【问题讨论】:

    标签: wsh


    【解决方案1】:

    在javascript中:

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

    我花了一些时间来理解它。所以我想至少会有一个人乐于在这里找到答案。

    【讨论】:

      【解决方案2】:

      【讨论】:

      • 我在 javascript 中试了一下,但我无法在文件对象上使用 GetLink 方法,即使该文件实际上是一个链接。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-11
      • 1970-01-01
      • 1970-01-01
      • 2013-01-19
      相关资源
      最近更新 更多