I have a logfile that is updated every 5 minutes. What I'd like to do is have a vbscript monitor this file and if the last date modified is greater than 30 minutes from the current time, send an email to me.
you will need to use the
LastDateModified property of the file.
you can get this by creating a ref to a file object.
If you stick with a simple vbscript which is always running you will need a nasty loop in it, something like
Do
Wscript.Sleep 60000
Wscript.Sleep 60000
Wscript.Sleep 60000
Wscript.Sleep 60000
Wscript.Sleep 60000
'im sure the 60000 is probably wrong
'5 mins has elapsed do the check
If DateDiff(n, aFile.DateLastModified, Now()) > 29 Then
'do something, send email?, write to eventlog?
End If
Loop
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.