I need to be able to get a scheduled task created programatically in VB6 to
run every X min, it also needs to run as logged in user so it wont require a
password.
If there's a different way besides NetScheduleJobAdd in VB6 I'd be up for
that as well.
Here is where I found the code for the creation of the scheduled task:
http://www.veign.com/vrc_codeview.asp?type=app&id=87
If it truly needs to run every minute, it would be easy to write a program
that executes the task every minute.
> If it truly needs to run every minute, it would be easy to write a program
> that executes the task every minute.
Nope. i need to actually create a scheduled task. This is code I'm trying to
use for a few different programs I'm working on. The task might run every
hour, every 5 min, or every day (can already be done). I'm basically trying
to get this so I can use it in all my future apps that might require a
scheduled task.
I know that there have been many previous questions and answers in this
newsgroup that are relevant. Other than that, I don't know anything about it
myself.
"Snuffy2" <Snu...@discussions.microsoft.com> wrote in message
news:C12DF7EA-286E-459F...@microsoft.com...
Thanx
"Mark Yudkin" <myudkinATcom...@boing.org> wrote in message
news:%2368SvVy...@TK2MSFTNGP10.phx.gbl...
You can't set minutes per se, but you can set multiple daily schedules, so
provided X is a divisor of 1440, you can set up 1440/X daily schedules. This
is how the XP task scheduler is documented, and it's what Eduardo did in his
code.
"Snuffy2" <snu...@yahoo.com> wrote in message
news:uxGMQo3Q...@TK2MSFTNGP15.phx.gbl...
That doesn't seem like the best way to do it. Unless I'm mising something.
"Mark Yudkin" <myudkinATcom...@boing.org> wrote in message
news:OugSzuBR...@TK2MSFTNGP09.phx.gbl...
> Take a GOOD look at trigger.cls and the Platform SDK documentation on the
> task scheduler.
I very strongly recommend you do this, as it answers your questions and
saves us both a lot of time.
---
You can use the MinutesDuration and MinutesInterval options to schedule down
to 1 minute. This is not quite the same thing as scheduling every 5 minutes,
but might do what you actually want (and is how MS handle notifications in
Sharepoint). This is available in Eduardo's Trigger class (Durations and
Interval properties, as per Eduardo's code in the trigger.cls, that you
appear not to want to look at).
From the Platform SDK, that you also appear not to want to read:
MinutesDuration
Number of minutes after the task starts that the trigger will remain active.
The number of minutes specified here must greater than or equal to the
MinutesInterval setting.
For example, if you start a task at 8:00 A.M. and want to repeatedly start
the task until 5:00 P.M., there would be 540 minutes in the duration.
MinutesInterval
Number of minutes between consecutive task executions. This number is
counted from the start of the previous task. The number of minutes specified
here must be less than or equal to the MinutesDuration setting.
For example, to run a task every hour from 8:00 A.M. to 5:00 P.M., set this
field to 60.
"Snuffy2" <snu...@yahoo.com> wrote in message
news:%236RviJd...@TK2MSFTNGP10.phx.gbl...
"Mark Yudkin" <myudkinATcom...@boing.org> wrote in message
news:%2333Fxpw...@TK2MSFTNGP10.phx.gbl...