PC Review Forums Newsgroups Windows XP Windows XP WMI HELP

Reply

HELP

 
Thread Tools Rate Thread
Old 02-07-2004, 09:03 PM   #1
tony roth
Guest
 
Posts: n/a
Default HELP


ok this code is a rip from the ms scripting site with some mods. My
problem is at just after invocation it list about 20+ files in in alpha
order that I know (think) that have not been modified, any ideas? Also later
on other files will show up that I think/know have not been modded.
thanks
tr


strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\cimv2")
Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
("SELECT * FROM __InstanceModificationEvent WITHIN 10 WHERE " _
& "TargetInstance ISA 'CIM_DataFile' and " _
& "TargetInstance.extension='exe' and TargetInstance.drive='c:'
and TargetInstance.Path = '\\windows\\system32\\'",,48)

Do
Set objLatestEvent = colMonitoredEvents.NextEvent
Wscript.Echo objLatestEvent.TargetInstance.Name & " modded " & date &"
"&time
Loop


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off