Use the AT (@) scheduler that come as part NT/2000.
The resource kit has a GUI for this command line tool. Steven Fowler, Principal
steve@fowlerconsulting.com
- Development, Training, and Consulting
write an application that checks the clock, calculates how long until a quarter til, then sleeps for that amount of time. When the sleep is done, have it shell the application that you want to launch at quarter til, then check the time until it runs again and sleep... in a loop
while true
nCyclesTilRun = CheckTime
Sleep nCyclesTilRun
shell theDesiredApp, OtherParams, etc.
wend
Function CheckTime() As Long
Dim CurrentTime As Date
Dim NumMins As Long
Dim Duration As Long
'Quick and dirty. You can make it more exact if needed.
CurrentTime = Now()
NumMins = Minute(CurrentTime)
If NumMins < 15 Then
Duration = 15 - NumMins
Else
Duration = 75 - NumMins
End If
Duration = 1000 * Duration
CheckTime = Duration
End Function
Here's the sleep bit:
Declare Sub Sleep Lib "kernel32" _
(byval dwMilliseconds as Long)
And shell:
Declare Function ShellExecute& Lib "shell32.dll" _
alias "ShellExecuteA" (ByVal hwnd As Long, ByVal _ lpOperation As String, ByVal lpFile As String, ByVal _ lpParameters As String, ByVal lpDirectory As String, _ ByVal nShowCmd As Long)
Thanks for the program. I copied the code and recieved an error message upon saving that read, "Only comments may appear after End Sub, End Function, or End Property." I think its referring to the Declare statements. What am I doing wrong.
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.