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 29 30 31 32 33 34 35 36 37 38 39 40 41
| Option Explicit
Dim WshShell, WshNetwork
Dim strComputer
Dim postesExclus(14)
Dim i, shouldDo
shouldDo = True
postesExclus(0) = "Janvier"
postesExclus(1) = "Fevrier"
postesExclus(2) = "Mars"
postesExclus(3) = "Avril"
postesExclus(4) = "Mai"
postesExclus(5) = "Juin"
postesExclus(6) = "Juillet"
postesExclus(7) = "Aout"
postesExclus(8) = "Septembre"
postesExclus(9) = "Octobre"
postesExclus(10) = "Novembre"
postesExclus(11) = "Decembre"
postesExclus(12) = "January"
postesExclus(13) = "February"
postesExclus(14) = "March"
Set WshShell = CreateObject("WScript.Shell")
Set WshNetwork = CreateObject("WScript.Network")
strComputer = WshNetwork.ComputerName
For i = 0 To Ubound(postesExclus)
If LCase(strcomputer) = LCase(postesExclus(i)) Then
shouldDo = False
'MsgBox strComputer & " est répertorié comme exclus donc pas d'action"
Exit For
End If
Next
If shouldDo Then
'MsgBox strComputer & " est concerné par l'action du script",, i
WshShell.Run("\\serveur\prog\lancement.exe", , false) 'false pour spécifier de continuer le script sans attendre la fin du programme
End If |
Partager