Vbscript temporisation avant shutdown
Résolu
d3mon
Messages postés
21
Date d'inscription
Statut
Membre
Dernière intervention
-
d3mon Messages postés 21 Date d'inscription Statut Membre Dernière intervention -
d3mon Messages postés 21 Date d'inscription Statut Membre Dernière intervention -
A voir également:
- Vba temporisation
- Excel compter cellule couleur sans vba - Guide
- Find vba - Astuces et Solutions
- Incompatibilité de type vba ✓ - Forum VB / VBA
- Erreur 13 incompatibilité de type VBA excel ✓ - Forum Excel
- Mkdir vba ✓ - Forum VB / VBA
2 réponses
Salut,
ton code ma bien aidé.
Voici donc le résulatat du code :
num = InputBox ("Entrez le temps avant l'Arrêt du système (ex : 500 = 0.5sec / 10000= 10sec)")
wscript.sleep ""&num&""
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate,(Shutdown)}!\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
objOperatingSystem.Shutdown()
Next
Merci beaucoup
ton code ma bien aidé.
Voici donc le résulatat du code :
num = InputBox ("Entrez le temps avant l'Arrêt du système (ex : 500 = 0.5sec / 10000= 10sec)")
wscript.sleep ""&num&""
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate,(Shutdown)}!\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
objOperatingSystem.Shutdown()
Next
Merci beaucoup