| |
mcbmcb0
Posts: 1
Score: 0
Joined: 1/11/2008
Status: offline
|
Hello A newb question about WMI: I'm monitoring folder activity using the following WMI based snippet, tho want to expand this to monitorr two or more folders. Can anyone advise? Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM __InstanceOperationEvent WITHIN " & strTime & " WHERE " _ & "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _ & "TargetInstance.GroupComponent= " _ & "'Win32_Directory.Name=" & Chr(34) & strDirToMonitor & Chr(34) & "'") Do 'While True Set objEventObject = colMonitoredEvents.NextEvent() strType = "__InstanceCreationEvent" strFile = objEventObject.TargetInstance.PartComponent strFileChange = StrReverse(objEventObject.TargetInstance.PartComponent) '... other stuff loop Thanks in advance Mike
|
|