允許以編程方式創(chuàng)建 Internet 資源的快捷方式。
WshUrlShortcut 對(duì)象是 WshShell 對(duì)象的子對(duì)象 必須使用 WshShell 對(duì)象的 CreateShortcut 方法創(chuàng)建 WshUrlShortcut 對(duì)象(例如,WshShell.CreateShortcut(strDesktop & "\Shortcut Script.lnk"))。
下面的示例演示創(chuàng)建 www.microsoft.com/china 的 URL 快捷方式。
<package>
<job id="vbs">
<script language="VBScript">
set WshShell = WScript.CreateObject("WScript.Shell")
set oUrlLink = WshShell.CreateShortcut(strDesktop & "\Microsoft Web Site.url")
oUrlLink.TargetPath = "http://www.microsoft.com/china"
oUrlLink.Save
</script>
</job>
<job id="js">
<script language="JScript">
var WshShell = WScript.CreateObject("WScript.Shell");
var oUrlLink = WshShell.CreateShortcut(strDesktop + "\\Microsoft Web Site.url");
oUrlLink.TargetPath = "http://www.microsoft.com/china";
oUrlLink.Save();
</script>
</job>
</package>
FullName 屬性(WshUrlShortcut 對(duì)象) | TargetPath 屬性