タイトル : Re: ショートカットの作成について 投稿日 : 2008/09/27(Sat) 12:37 投稿者 : 花ちゃん
質問される前にこの掲示板のワード検索で過去のログ等検索されましたか? 又、どこで、どのようなエラーがでて、どの部分が解らないかを書かないと。 'プロジェクト→参照の追加→COM→Windows Script Host Object Model を参照設定して下さい。 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim wsh As New IWshRuntimeLibrary.WshShell Dim disk As String = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop) Dim sc As IWshRuntimeLibrary.IWshShortcut sc = CType(wsh.CreateShortcut(disk & "\vb9図書.exeのショートカット.lnk"), IWshRuntimeLibrary.IWshShortcut) sc.TargetPath = "d:\図書.exe" sc.Save() System.Runtime.InteropServices.Marshal.FinalReleaseComObject(sc) sc = Nothing System.Runtime.InteropServices.Marshal.FinalReleaseComObject(wsh) wsh = Nothing End Sub |