In Windows Task Scheduler, you can run tasks both on the schedule and after the specific event is registered in the log. (It has been described in the article “Event Triggers in Windows“.) In this article we’ll consider how to automatically start a Scheduler task after the previous task is completed. Let’s take a look at the algorithm to configure dependencies of running Scheduler tasks, which you can customize to meet your needs.
In my case, after one script had been completed I had to start another script from another user account. So these actions could not be united in a single task.
Suppose, we have to start the Pong Scheduler task after the Ping task is completed. When any task is started or completed, the information about this event is registered in the system log. We’ll focus on the event of Ping task completion.
Open Task Scheduler console (Taskschd.msc), locate and select Ping event, and in the bottom panel go to the History tab, which contains the information about all events associated with this task. We need the event with the Event ID 102 (Task completed) which is generated after the task is completed.

Open the detailed event description by going to the Detail tab and enable the XML View of the event. According to the XML data, you can get all details of the event necessary to create a filter. In particular, we need:
EventID: 102Provider-Name: Microsoft-Windows-TaskScheduler
Channel: Microsoft-Windows-TaskScheduler/Operational
TaskName: \ping

When creating a trigger for the Pong task, we have to create a trigger condition for the task to start when the event with the ID 102 appears in the log (Task trigger On an event). But the problem is that EventID 102 appears after any task is completed, not only the Ping task. 
However, it is possible to create a more flexible condition for event selection (Custom) if a standard filter does not help to select the event accurately enough. Click New Event Filter:

Create a new event filter by specifying the data from the XML View of the event:
Events Logs: Microsoft-Windows-TaskScheduler/OperationalEvent source: TaskScheduler
Task category: Task completed

Then go to the XML tab and have a look at the following filter view (XPath):
<QueryList>
<Query Id="0" Path="Microsoft-Windows-TaskScheduler/Operational">
<Select Path="Microsoft-Windows-TaskScheduler/Operational">*[System[Provider[@Name='Microsoft-Windows-TaskScheduler'] and Task = 102]]</Select>
</Query>
</QueryList>

Change the XPath code to the following one, which will filter the log and search for TaskCompleted event for the \ping task:
<QueryList>
<Query Id="0" Path="Microsoft-Windows-TaskScheduler/Operational">
<Select Path="Microsoft-Windows-TaskScheduler/Operational">*[System[Provider[@Name='Microsoft-Windows-TaskScheduler'] and Task = 102]]</Select>
</Query>
</QueryList>
After the event has been added, try to start the ping task. When it is completed, the pong task has to be started immediately.
XPath explanation is displayed below:
