Enable / Disable scheduled task using vb.net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know some code that will allow me to enable and/or disable a task
which already exists in the task scheduer. I have a task which runs at 15 min
intervals and from time to time I want to disable (and later enable) that
task. I'd like to do so programatically as part of another application
instead of opening the task scheduler and right clicking on the relevant task.

Any guidance or suggestions for code would be appreciated

Regards

Michael Bond
 
Does anyone know some code that will allow me to enable and/or disable a task
which already exists in the task scheduer. I have a task which runs at 15 min
intervals and from time to time I want to disable (and later enable) that
task. I'd like to do so programatically as part of another application
instead of opening the task scheduler and right clicking on the relevant task.

Any guidance or suggestions for code would be appreciated

Regards

Michael Bond

Michael...

You can grap a copy of my wrapper for the task scheduler...
www.mtogden.com/~tom/files/SchedulingAgent.NET.zip
 
Does anyone know some code that will allow me to enable and/or disable a task
which already exists in the task scheduer. I have a task which runs at 15 min
intervals and from time to time I want to disable (and later enable) that
task. I'd like to do so programatically as part of another application
instead of opening the task scheduler and right clicking on the relevant task.

Any guidance or suggestions for code would be appreciated

Regards

Michael Bond

I better give a little more explanation. If you grab the file, what you
get is a C# project. This project compiles to a .NET dll that wraps the
task scheduler's com interfaces. There are other similar libraries out
there as well... Any way, just include the project in your solution and
reference it from your vb projec and you should be able to do something
like:

Dim ts As New TaskScheduler
Dim tsk As Task = ts ("MyTask")

tsk.Disabled = true ' disable the task

ts.Dispose ()


HTH
 
Tom

My Tech support staff have disabled C# on my .NET installation .... because
"they do not support it" ...... I cannot compile the project ..... and I
cannot convince my Tech support to enable C# (despite the fact they are not
being asked to support it) ...... any further suggestions

Michael
 
Back
Top