I put together a quick, though not heavily tested script, that could do it for you. You'll need to make some changes for your environment. It's also only configured to check a local file. I'm sure there are improvements to me made as well.
All you need to do is copy and save this as a .vbs file and then create a scheduled task to run (and repeat every x mins/hours) this script. I recommend testing first, as always.
'Code starts below.
Dim WshShell, objfso, objFile1, objFileMonitorData, objEmail
Dim lngSize1, lngSize2, strCurrDir, strFileToMonitor, strFileMonitorText
'on error resume next
Set WshShell = CreateObject("Wscript.Shell")
set objfso = CreateObject("Scripting.FileSystemObject")
strFileToMonitor = "path\to\file"
strCurrDir = WshShell.CurrentDirectory
If Not objfso.FileExists(strFileToMonitor) Then
WScript.Echo strFileToMonitor & " does not exist."
Else
Set objFile1 = objfso.GetFile(strFileToMonitor)
lngSize1 = objFile1.Size
End If
If Not objfso.FileExists(strCurrDir & "\FileSizeMonitor.dat") Then
Set objFileMonitorData = objfs

penTextFile(strCurrDir & "\FileSizeMonitor.dat",2,True)
objFileMonitorData.WriteLine lngSize1
objFileMonitorData.Close
Else
Set objFileMonitorData = objfs

penTextFile(strCurrDir & "\FileSizeMonitor.dat",1)
strFileMonitorText = objFileMonitorData.ReadLine
lngSize2 = Clng(strFileMonitorText)
objFileMonitorData.Close
Set objFileMonitorData = Nothing
If lngSize1 > lngSize2 Then
Set objFileMonitorData = objfs

penTextFile(strCurrDir & "\FileSizeMonitor.dat",2)
objFileMonitorData.WriteLine lngSize1
objFileMonitorData.Close
Set objFileMonitorData = Nothing
Else
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "whatever@email.address"
objEmail.To= "you@email.address"
objEmail.Subject = "Monitored text File unchanged"
objEmail.TextBody = "The file " & strFileToMonitor & " has not changed since the last time it was checked."
objEmail.Configuration.Fields.Item _
("
= 2
objEmail.Configuration.Fields.Item _
("
= "change this to smtp server address"
objEmail.Configuration.Fields.Item _
("
= 25
objEmail.Configuration.Fields.Update
objEmail.Send
Set objEmail = Nothing
End If
End If
Set objFile1 = Nothing
Set sFileMonitorData = Nothing
Set objfso = Nothing
Set WshShell = Nothing
---------------------------------------
Bob Beck
Systems Administrator