为快捷方式指派相对路径,或确定快捷方式的相对路径。
object.RelativePath
字符串。
下面的代码显示快捷方式的相对路径。
Dim WshShell, WshShortcut
Set WshShell = WScript.CreateObject ("WScript.Shell")
Set WshShortcut = WshShell.CreateShortcut("MyScript.lnk")
WshShortcut.RelativePath
= "C:\Scripts\"
var WshShell = WScript.CreateObject ("WScript.Shell");
var WshShortcut = WshShell.CreateShortcut("MyScript.lnk");
WshShortcut.RelativePath
= "C:\\Scripts\\";