' The following script is copyright (C) 1999 by Jason Levine & Queso Technologies. ' You are free to modify and redistribute this script so long as this header stays ' attached to it at all times. ' For more information, visit http://www.queso.com/ ' This script originally attached to MRTG Statistic Updater: ' http://www.queso.com/MRTGStatUpdater.htm ' ' What is this? It is a Windows Scripting Host script which will check the current ' time, and then run a command line based on if the minute is a multiple of 5 or 20. ' It would be trivial to modify these two numbers to whatever you want. ' ' To be of any use, you need to set up some scheduling application to run this script ' every minute (so that it has the full benefit of checking the time every minute). ' ' Windows Scripting Host: ' http://msdn.microsoft.com/isapi/gomscom.asp?TARGET=/msdownload/vbscript/scripting.asp ' ' INSTRUCTIONS for editing this script: ' - below are two lines which set the values of "cmdLine1" and "cmdLine2". Edit these ' lines, substituting in the full path to whatever you would wish each to run. ' Out of the box, cmdLine1 is the command line for when the minute is a multiple of 20, ' and cmdLine2 is the command line for when the minute is a multiple of 5. ' - remember to use full paths for the command lines, like this: ' cmdLine1 = "c:\perl\bin\perl.exe c:\mrtg\run\mrtg c:\mrtg\run\router1.cmd" ' You may want to use 8.3 notation for any long file or folder names, too; they just ' plain work better sometimes. ' - if you want to change the minute intervals, the two lines with "MinVar Mod" are the ' lines in which these values are set. ' ' Enjoy. Dim MinVar, DlgVar Dim WSHShell Dim cmdLine1, cmdLine2 ' cmdLine1 runs when minute is multiple of 20 cmdLine1 = "c:\winnt\notepad.exe" ' cmdLine2 runs when minute is multiple of 5, but not 20 cmdLine2 = "C:\Progra~1\Window~1\Access~1\wordpad.exe" MinVar = Minute(Now) ' the next line tests to see if the minute is a multiple of 5... If (MinVar Mod 5) = 0 Then Set WSHShell = WScript.CreateObject("WScript.Shell") ' the next line tests to see if the minute is a multiple of 20... if (MinVar Mod 20) = 0 Then WSHShell.Run(cmdLine1) Else WSHShell.Run(cmdLine2) End If End If Set WSHShell = Nothing