Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If My.Computer.FileSystem.FileExists(My.Computer.FileSystem.SpecialDirectories.Desktop & "\ShellLink.LNK") Then Button1.Enabled = False
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strFolder As String = My.Computer.FileSystem.CurrentDirectory, strEXE As String = "ShellLink.exe"
Dim objWS As Object
objWS = CreateObject("WScript.Shell")
With objWS.CreateShortCut(objWS.SpecialFolders("Desktop") & "\ShellLink.LNK") '& Replace(strEXE, ".EXE", ".LNK", 1, , 1))
.TargetPath = objWS.ExpandEnvironmentStrings(strFolder & "\" & strEXE)
.WorkingDirectory = strFolder
.Description = "ShellLink"
.WindowStyle = 4
.IconLocation = objWS.ExpandEnvironmentStrings(strFolder & "\" & strEXE & ",0")
.Save()
End With
Button1.Enabled = False
End Sub
End Class