Closed wmortume closed 2 years ago
This functionality is not available from the native Windows Task Scheduler. The task scheduler runs as an elevated service. Therefore, the inline execution you are suggesting would result in a significant security hole.
To run private code, you either need to call an executable with it, using ExecAction, or write a COM object per the ITaskServiceHandler interface (see home page), using ComHandlerAction.
I'm confused on the com object, would I pass the method on the com handler? could you give a quick code example?
https://github.com/dahall/ITaskHandlerTemplate
You create a new project with the code in it. There is no way to pass a function.
What a bummer, seems to have alll the components i need, easy to use. but I cant go like "task.Actions.Add(() => ExecuteAction());" Well, that erases it from the realm of usable compoments :x
Task actions seems to only take in a string path or
TAction
but won't let me pass an in-code method. How would I do that?