Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Check Every 30 Minutes to See If a File Has Been ModifiedContent of Check Every 30 Minutes to See If a File Has Been Modified.vbsMD5 Hash: DE0E0C91AD5DC96D97056F81593F730D |
||
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colFiles = objWMIService.ExecQuery _ ("Select * from CIM_Datafile Where Name = 'C:\\Scripts\\Application.log'") For Each objFile in colFiles strOriginalTimestamp = objFile.LastModified Next Wscript.Echo "Monitoring application log file: " & Now Wscript.Echo Do While True Wscript.Sleep 1800000 Set colFiles = objWMIService.ExecQuery _ ("Select * from CIM_Datafile Where Name = 'C:\\Scripts\\Application.log'") For Each objFile in colFiles strLatestTimestamp = objFile.LastModified Next If strLatestTimestamp <> strOriginalTimestamp Then strOriginalTimestamp = strLatestTimeStamp Else Wscript.Echo "ALERT: " & Now Wscript.Echo "The application log file has not been modified in the last 30 minutes." Wscript.Echo strOriginalTimestamp = strLatestTimeStamp End If Loop | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |