Windows 脚本宿主  

RelativePath 属性

为快捷方式指派相对路径,或确定快捷方式的相对路径。

object.RelativePath

参数

object
WshShortcut 对象。

说明

字符串。

示例

下面的代码显示快捷方式的相对路径。

[VBScript]
Dim WshShell, WshShortcut
Set WshShell = WScript.CreateObject ("WScript.Shell")
Set WshShortcut = WshShell.CreateShortcut("MyScript.lnk")
WshShortcut.RelativePath = "C:\Scripts\"
[JScript]
var WshShell = WScript.CreateObject ("WScript.Shell");
var WshShortcut = WshShell.CreateShortcut("MyScript.lnk");
WshShortcut.RelativePath = "C:\\Scripts\\";

请参阅

WshShortcut 对象