WshUrlShortcut オブジェクト
URL ショートカットへのオブジェクト参照を作成します。
解説
WshUrlShortcut オブジェクトは WshShell オブジェクトの子オブジェクトです。WshUrlShortcut オブジェクトを作成するには、WshShell のメソッドである CreateShortcut を使用します (例 : WshShell.CreateShortcut(strDesktop & "\ショートカット スクリプト.lnk")
)。
使用例
次のコードは、www.microsoft.com への 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 = "https://www.microsoft.com"
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 = "https://www.microsoft.com";
oUrlLink.Save();
</script>
</job>
</package>
プロパティ
FullName プロパティ (WshUrlShortcut オブジェクト) | TargetPath プロパティ