kfirba
kfirba

Reputation: 5441

run a task after another task has ran

I have two tasks:

  1. runs WAMP
  2. opens Google Chrome

What I'm trying to do is to trigger task number 2 after task number 1 has already triggered. After WAMP's task has ran I would like to run Google Chrome's task.

Think of it as a callback function. When task 1 has finished running, trigger task 2.

Note: I'm trying to do that using windows 8.1 task scheduler

Upvotes: 10

Views: 16607

Answers (2)

Sandesh Salunke
Sandesh Salunke

Reputation: 19

Lets say, I have Task1 scheduled on my server, now I want to execute Task2 on successful completion of Task1, then create Task2 with trigger as below

<QueryList>
  <Query Id="0" Path="Microsoft-Windows-TaskScheduler/Operational">
    <Select Path="Microsoft-Windows-TaskScheduler/Operational">*[EventData
[@Name='TaskSuccessEvent'][Data[@Name='TaskName']='\Task1']]</Select>
  </Query>
</QueryList>

Run Task Scheduler After Another

Upvotes: 0

Lorena Pita
Lorena Pita

Reputation: 1516

You can Trigger the Task2 with 'On an event' option. Go to (Setting - Custom -Edit Event Filter) and put this code in the XML tab.

<QueryList>
  <Query Id="0" Path="Microsoft-Windows-TaskScheduler/Operational">
    <Select Path="Microsoft-Windows-TaskScheduler/Operational">*[EventData
[@Name='TaskSuccessEvent'][Data[@Name='TaskName']='\Task1']]</Select>
  </Query>
</QueryList>

Upvotes: 11

Related Questions