R
Ricardo Ito
Hi.
I found some scripts and I try to merge and the result was:
--
strComputer = "mycomputer"
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.Name='c:\\temp\\text.txt'")
Do
Set objLatestEvent = colMonitoredEvents.NextEvent
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "(e-mail address removed)"
objEmail.To = "(e-mail address removed)"
objEmail.Subject = "The growth of the file"
objEmail.Textbody = "The file is growing!!!"
objEmail.Send
Loop
I found some scripts and I try to merge and the result was:
--
strComputer = "mycomputer"
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.Name='c:\\temp\\text.txt'")
Do
Set objLatestEvent = colMonitoredEvents.NextEvent
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "(e-mail address removed)"
objEmail.To = "(e-mail address removed)"
objEmail.Subject = "The growth of the file"
objEmail.Textbody = "The file is growing!!!"
objEmail.Send
Loop