Vbscript temporisation avant shutdown
Résolu/Fermé
d3mon
Messages postés
21
Date d'inscription
mercredi 2 janvier 2008
Statut
Membre
Dernière intervention
30 juin 2009
-
8 févr. 2008 à 18:55
d3mon Messages postés 21 Date d'inscription mercredi 2 janvier 2008 Statut Membre Dernière intervention 30 juin 2009 - 9 févr. 2008 à 16:16
d3mon Messages postés 21 Date d'inscription mercredi 2 janvier 2008 Statut Membre Dernière intervention 30 juin 2009 - 9 févr. 2008 à 16:16
A voir également:
- Vba temporisation
- Excel compter cellule couleur sans vba - Guide
- Temporisation osd - Forum Minecraft
- Mkdir vba ✓ - Forum VB / VBA
- L'indice n'appartient pas à la sélection vba ✓ - Forum Programmation
- Autofill vba ✓ - Forum Excel
2 réponses
fiddy
Messages postés
11069
Date d'inscription
samedi 5 mai 2007
Statut
Contributeur
Dernière intervention
23 avril 2022
1 844
8 févr. 2008 à 22:14
8 févr. 2008 à 22:14
Salut
As-tu essayé : wscript.sleep 5000 pour une tempo de 5 secondes par exemple ?
As-tu essayé : wscript.sleep 5000 pour une tempo de 5 secondes par exemple ?
d3mon
Messages postés
21
Date d'inscription
mercredi 2 janvier 2008
Statut
Membre
Dernière intervention
30 juin 2009
4
9 févr. 2008 à 16:16
9 févr. 2008 à 16:16
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