![]()
Non capisco... Quell'altro thread sembra sparito!!!
Comunque ecco il codice: (dimmi se funziona)
Private L_Welcome_MsgBox_Message_Text As String
Private L_Welcome_MsgBox_Title_Text As String
Sub Welcome()
Dim intDoIt
intDoIt = MsgBox(L_Welcome_MsgBox_Message_Text, _
vbOKCancel + vbInformation, _
L_Welcome_MsgBox_Title_Text)
If intDoIt = vbCancel Then
End
End If
End Sub
Private Sub Form_Load()
L_Welcome_MsgBox_Message_Text = "Questo script creerà un collegamento a Blocco note sul desktop."
L_Welcome_MsgBox_Title_Text = "Esempio di Windows Scripting Host"
Call Welcome
Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")
Dim MyShortcut, MyDesktop, DesktopPath
DesktopPath = WSHShell.SpecialFolders("Desktop")
Set MyShortcut = WSHShell.CreateShortcut(DesktopPath & "\Collegamento a Blocco note.lnk")
MyShortcut.TargetPath = WSHShell.ExpandEnvironmentStrings("%windir%\notepa d.exe")
MyShortcut.WorkingDirectory = WSHShell.ExpandEnvironmentStrings("%windir%")
MyShortcut.WindowStyle = 4
MyShortcut.IconLocation = WSHShell.ExpandEnvironmentStrings("%windir%\notepa d.exe, 0")
MyShortcut.Save
MsgBox "Un collegamento a Blocco note è ora presente sul desktop"
End
End Sub


Rispondi quotando