Recurring events er... tasks and launching programs

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
redbeard
Member
Posts: 17
Joined: Thu Aug 10, 2006 12:39 am

Recurring events er... tasks and launching programs

Post by redbeard »

I'd like to have a task run every 5 minutes on the 5's and 0's of the minutes of the hour (mod 5). In using the Sleep Timer, I find that the stopping, triggering the task, and restarting the timer takes a second or two, or sometimes more, and things slowly creep out of sync.

At present, the only way I see to do this is to call a script every minute, test the minute of the System Time, and if it's mod 5, launch my program. Am I missing anything in HB that could help me reach my goal here more easily?

Also, in trying to launch my program using CreateObject "Wscript.Shell" etc. I am running into syntax errors that I can't get around, while this same script works from the command line. Is something within HB preventing my launching programs or other scripts from within an HB script? Should I be using a different launch command?

FWIW, I'm trying to run MRTG (perl.exe) every 5 minutes from HB. Here's my script:

Code: Select all

  dim Cmd
  Cmd = "%comspec% /c c:\perl\bin\perl.exe e:\mrtg-2.14.4\bin\mrtg e:\mrtg\ups1400.cfg"
  CreateObject("Wscript.Shell").Run(Cmd, 0, True)
[/code]
- rb
Post Reply