I appreciate this has already been marked as answered but I have a requirement in my scenario where I'm not able to modify the 'triggering' task.
The solution is to create a task with a custom event filter trigger which fires when the trigger task completes. The source for this solution comes from here but I've explained the main part below.
In Task Scheduler select the trigger task and in the pane below select the History tab. Assuming this task has completed at least once before you should be able to see an event with a Task Category of Task Completed. Right click on the Task Completed event and select Event Properties. In the Details tab of the Event Properties window which opens select the XML View which should look something like this (potentially sensitive information removed):
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft-Windows-TaskScheduler" Guid="{DE7B24EA-73C8-4A09-985D-5BDADCFA9017}" />
<EventID>102</EventID>
<Version>0</Version>
<Level>4</Level>
<Task>102</Task>
<Opcode>2</Opcode>
<Keywords>0x8000000000000001</Keywords>
<TimeCreated SystemTime="2014-01-21T15:28:27.746689500Z" />
<EventRecordID>978</EventRecordID>
<Correlation ActivityID="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" />
<Execution ProcessID="10656" ThreadID="11656" />
<Channel>Microsoft-Windows-TaskScheduler/Operational</Channel>
<Computer>XXXXXXXXXXXXXXXXXXXXXXXXXX</Computer>
<Security UserID="S-X-X-XX-XXXXXXXXXX-XXXXXXXXXX-XXXXXXXXXX-XXX" />
</System>
<EventData Name="TaskSuccessEvent">
<Data Name="TaskName">\ping</Data>
<Data Name="UserContext">XXXXXXXXXX\XXXXXXXXXXXXX</Data>
<Data Name="InstanceId">{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}</Data>
</EventData>
</Event>
The custom trigger you need to write is basically an XPath expression which evaluates to a filter which matches the Task Completed event of the triggering task. With a task named "ping" the trigger would be:
<QueryList>
<Query Id="0" Path="Microsoft-Windows-TaskScheduler/Operational">
<Select Path="Microsoft-Windows-TaskScheduler/Operational">*[EventData[@Name='TaskSuccessEvent'][Data[@Name='TaskName']='\ping']]</Select>
</Query>
</QueryList>
In the Edit Trigger window you can then set 'Delay task for: 15 minutes' which should achieve the desired result without needing to modify the original task.
There are loads of other XPaths that one could write to make fancier triggers. This blog post provides a bit more information and this Microsoft documentation seems like a good start for deeper reading.
Could the first batch file not just call the second batch file just before exiting? – panhandel – 2014-01-16T22:34:02.637
@panhandel I thought of that already. The problem is that the batch file starts the program and closes so that the console doesn't remain open. The way it is set up, the second batch file would be called immediately once the program is opened. – DaveTheMinion – 2014-01-16T22:36:29.470
1
Hmm. Hip shot here, but batch "START /WAIT {cmd}" perhaps? http://serverfault.com/questions/245393/how-do-you-wait-for-an-exe-to-complete-in-batch-file
– panhandel – 2014-01-16T22:39:26.500@panhandel I am trying to find an ideal way to do this using a task trigger. I am looking through the options (On a schedule, On an event, etc), but I don't know how to configure any of these to do what it is I am trying to do. – DaveTheMinion – 2014-01-16T22:44:48.503
Hopefully that 'At' works for you. I found an interesting lead based on querying the event log via XML, but once the first task has completed once, it will never fire the second task again - more here: http://goo.gl/LtozZ4
– panhandel – 2014-01-17T00:14:21.530@panhandel I got 'At' working, but I decided that I didn't like that the batch file always showed the console, so I wrote a Visual Basic Script that combines the two tasks into one. The Visual Basic script has a fifteen minute sleep. – DaveTheMinion – 2014-01-17T01:18:37.343