provate con questo:
chiamata di esempio: Call CreaCollegamentoDesktop("MIO PROGRAMMA", PercorsoEseguibile, , PercorsoIcona, PercorsoDirLavoro)
Public Sub CreaCollegamentoDesktop(ByVal sName As String, ByVal sPath As String, Optional HotKey As String = "", Optional sIcon As String = "", Optional sWorkingDirectory As String = "", Optional sSubFolder As String = "", Optional iWinStyle As Integer = vbNormalFocus)
Dim WshShell As Object
Dim oShellLink As Object
Dim sLinkPath As String
Set WshShell = CreateObject("WScript.Shell")
sLinkPath = WshShell.SpecialFolders("Desktop")
On Error Resume Next
If sSubFolder <> "" Then
sLinkPath = sLinkPath & "\" & sSubFolder
If Dir(sLinkPath) = "" Then MkDir sLinkPath
End If
On Error GoTo 0
Set oShellLink = WshShell.CreateShortCut(sLinkPath & "\" & sName & ".lnk")
oShellLink.WindowStyle = iWinStyle
oShellLink.HotKey = sHotKey
oShellLink.TargetPath = sPath
oShellLink.IconLocation = sIcon
oShellLink.Description = sName
oShellLink.WorkingDirectory = sWorkingDirectory
oShellLink.Save
Set oShellLink = Nothing
Set WshShell = Nothing
End Sub
:mavieni: