voici ce que j'ai fais
Dim mess, Response, oShell
mess="Voulez vous arrêter le service spool ?" &vbCrLf
Set oShell = Wscript.CreateObject("WScript.Shell")
Reponse = oShell.Popup(mess, 10, "script arrêt redémarrage service spool", vbYesNo)
If Reponse = vbYes Then
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\" _
& strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
("Select * from Win32_Service Where Name ='Spooler'")
For Each objService in colListOfServices
objService.StopService()
Wscript.Echo "Spooler d'impression arreté"
Next
Else If Reponse = VbNo then
mess="Voulez vous démarrer le service spool ?" &vbCrLf
Set oShell = Wscript.CreateObject("WScript.Shell")
Reponse = oShell.Popup(mess, 10, "script arrêt redémarrage service spool", vbYesNo)
If Reponse = vbYes Then
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\" _
& strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
("Select * from Win32_Service Where Name ='Spooler'")
For Each objService in colListOfServices
objService.StartService()
WScript.Echo "Spooler d'impression démarré"
Next
Else
MsgBox ("Vous avez répondu NON - Arrêt du script !!!")
WScript.Quit
End if
End If
End If
WScript.Quit
et il marche, merci quand meme pour ton aide