Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Check  Every  30  Minutes  to  See  If  a  File  Has  Been  Modified  

 Content of Check Every 30 Minutes to See If a File Has Been Modified.vbs
MD5 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 ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a