1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Call Shortcut(WScript.ScriptFullName,"Nom de mon vbscript")
MsgBox "Hello World !",vbInformation,"Test de Startup"
'***************************************************************************
Sub Shortcut(Application_Path,ShortcutName)
Dim objShell,fso,StartupPath,objShortCut,MyTab,strCurDir
Set objShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
strCurDir = fso.GetParentFolderName(WScript.ScriptFullName)
MyTab = Split(Application_Path,"\")
If ShortcutName = "" Then
ShortcutName = MyTab(UBound(MyTab))
End if
StartupPath = objShell.SpecialFolders("Startup")
Set objShortCut = objShell.CreateShortcut(StartupPath & "\" & ShortcutName & ".lnk")
objShortCut.TargetPath = Chr(34) & Application_Path & Chr(34)
objShortCut.Description = "Mon Application"
ObjShortCut.IconLocation = "%SystemRoot%\system32\shell32.dll,138"
objShortCut.Save
End Sub
'***************************************************************************** |
Partager