views:

65

answers:

1

Is there anyway using the ITask interface to communicate with a scheduled task? I have tasks that users can cancel, pause, etc and a main console that displays information about the tasks. Right now I can only tell if they are running or not via the GetStatus method. What I would like to do is connect to the task and pass a string (potentially xml). Anyone know if this is possible?

+1  A: 

The only strings you can pass to an ITask object are a directory path and command-line parameters. You cannot communicate with the task itself while it is running.

On the other hand, if you use the Task Scheduler 2.0 interfaces instead, then ITaskDefinition has a Data property that you can assign arbitrary text to.

Remy Lebeau - TeamB
Thank you. Unfortunately ITaskDefinition is only supported on 2008+. I need to be backwards compatible to a minimum of XP. :(
Zenox