Results 1 to 8 of 8

Thread: Windows Task Scheduler API

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Posts
    1,938

    Default Windows Task Scheduler API

    Has anyone done any work with the above API?

    I have imported the Automation classes and have this working all the way till the last bit with is the task registration

    It fails and return a NULL variant but no errors.

    the function in question is

    Code:
        // Create new task.
        Function ComRegisterTaskDefinition String llPath Variant llpDefinition Integer llflags Variant llUserId Variant llpassword OLE_TASK_LOGON_TYPE llLogonType Variant llsddl Returns Variant
            Handle hDispatchDriver
            Variant retVal
            Get phDispatchDriver to hDispatchDriver
            Send PrepareParams to hDispatchDriver 7
            Send DefineParam to hDispatchDriver OLE_VT_BSTR llPath
            Send DefineParam to hDispatchDriver OLE_VT_DISPATCH llpDefinition
            Send DefineParam to hDispatchDriver OLE_VT_I4 llflags
            Send DefineParam to hDispatchDriver OLE_VT_VARIANT llUserId
            Send DefineParam to hDispatchDriver OLE_VT_VARIANT llpassword
            Send DefineParam to hDispatchDriver OLE_VT_I4 llLogonType
            Send DefineParam to hDispatchDriver OLE_VT_VARIANT llsddl
            Get InvokeComMethod of hDispatchDriver 11 OLE_VT_DISPATCH to retVal
            Function_Return retVal
        End_Function
    no matter what I call this with I cannot get a successful result. All permutations of allowable value etc fails
    Code:
     Get ComRegisterTaskDefinition of hoFolder 'MyTask' vTaskDefinition OLETASK_CREATE_OR_UPDATE vUserId vPassword OLETASK_LOGON_INTERACTIVE_TOKEN_OR_PASSWORD OLE_VT_Empty to vTask
    A broad question but I figure someone may have done this
    Last edited by Chris Spencer; 25-Apr-2021 at 05:20 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •