Results 1 to 3 of 3

Thread: [RESOLVED] Create shorcut to exe

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2011
    Posts
    15

    [RESOLVED] Create shorcut to exe

    How to create a shortcut of application (C:\MyApp.exe) to desktop with icon?

    EDIT: I've find the solution...

    Imports IWshRuntimeLibrary
    Imports System.Environment

    Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim shell As WshShell = New WshShellClass
    Dim Desktop As String = Environment.GetFolderPath(SpecialFolder.DesktopDirectory)
    Dim shortcut As WshShortcut = shell.CreateShortcut(Desktop & "/MyApp.lnk")
    shortcut.TargetPath = "C:\MyApp.exe"
    shortcut.Description = "Description (optional)"
    shortcut.Save()
    End Sub
    End Class
    Last edited by rossi_4656; Oct 17th, 2011 at 06:56 AM.

  2. #2
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,713

    Re: Create shorcut to exe

    Even though you have a solution you might want to check out the library I did for this.

    http://www.vbforums.com/showpost.php...24&postcount=5

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2011
    Posts
    15

    Re: Create shorcut to exe

    Thank you very much for the library

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width