Bonjours,
Voila il y a deux jours je me suis acheter un livre "autoformation aux scripts" de ed Wilson, je suis au chapitre 2 sur les boucles, et la on apprend le "do while ... loop" il donne un script en exemple helas celui-ci ne fonctionne pas, j'ai beau cherche je ne trouve pas.
voici le scripte en question :
je suis preneur si quelqu'un trouve le problème dans ce script, sans toucher a l'en-tête et aux référence.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 Option Explicit 'On Error Resume Next Const FIVE_SEC =5000 Const LOCAL_HARD_DISK = 3 Dim colMonitoredDisks Dim objWMIservice Dim objDiskChange Dim i Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}").ExecQuery _ ("SELECT * FROM Win32_process") Set colMonitoredDisks = objWMIService.ExecNotificationQuery _ ("Select * from __instancemodificationevent within 30 where TargetInstance isa Win32_LogicalDisk") i=0 Do While i = 0 Set objDiskChange = colMonitoredDisks.NextEvent If objDiskChange.TargetInstance.DriveType = LOCAL_HARD_DISK Then If objDiskChange.TargetInstance.Size < 100000000 Then WScript.Echo "L'espace disque libre est inferieur a 100 Kilo Octets." WScript.Sleep(FIVE_SEC) End If End If Loop
merci d'avance
Partager