1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| Option Explicit
Const Key = "HKCU\Software\Microsoft\Windows\CurrentVersion\Run\"
Dim WS, AppName, AppTitle, fso, PathToScript
Set WS = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
AppTitle = "Launcher"
PathToScript = fso.GetFile(Wscript.ScriptFullName).ShortPath
AppName = Wscript.FullName
' Vérifie si la valeur existe, sinon l'inscrit.
With WS
On Error Resume Next ' Utile uniquement à la première exécution du script
If .RegRead(Key & AppTitle) = "" Or _
.RegRead(Key & AppTitle) <> AppName & " " & PathToScript Then
.RegWrite Key & AppTitle, AppName & " " & PathToScript
Else
' Nothing to do
End If
End With
'===============Lancement des progs =============
' Page iternet
WS.Run "iexplore.exe https://cmontmorency.moodle.decclic.qc.ca", 1, False ' False pour ne pas attendre Iexplore.exe
Dim net
Set net = CreateObject("WScript.Network")
net.MapNetworkDrive "S:", "\\HP_4\Scripts"
WS.Run "Explorer.exe S:", 1, False |
Partager