L_Welcome_MsgBox_Message_Text = "このスクリプトはデスクトップにメモ帳へのショートカットを作成します。" L_Welcome_MsgBox_Title_Text = "Windows スクリプティング ホスト サンプル" Call Welcome() Dim WSHShell Set WSHShell = WScript.CreateObject("WScript.Shell") Dim MyShortcut, MyDesktop, DesktopPath ' Read desktop path using WshSpecialFolders object DesktopPath = WSHShell.SpecialFolders("Desktop") ' Create a shortcut object on the desktop Set MyShortcut = WSHShell.CreateShortcut(DesktopPath & "\メモ帳へのショートカット.lnk") ' Set shortcut object properties and save it MyShortcut.TargetPath = WSHShell.ExpandEnvironmentStrings("%windir%\notepad.exe") MyShortcut.WorkingDirectory = WSHShell.ExpandEnvironmentStrings("%windir%") MyShortcut.WindowStyle = 4 MyShortcut.IconLocation = WSHShell.ExpandEnvironmentStrings("%windir%\notepad.exe, 0") MyShortcut.Save WScript.Echo "メモ帳へのショートカットが作成されました。" ' ******************************************************************************** ' * ' * Welcome ' * Sub Welcome() Dim intDoIt intDoIt = MsgBox(L_Welcome_MsgBox_Message_Text, _ vbOKCancel + vbInformation, _ L_Welcome_MsgBox_Title_Text ) If intDoIt = vbCancel Then WScript.Quit End If End Sub