Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


monitor activity in more than one folder

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,55296
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> monitor activity in more than one folder
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 monitor activity in more than one folder - 1/11/2008 9:41:45 PM   
  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

 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> monitor activity in more than one folder Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts