batch file - start command in Task1 triggers Task2 before it's On event trigger defined in Task scheduler -


i posting question separately avoid confusion last question. trying same thing differently.

using windows task scheduler (taskschd.msc) :

  1. i created 2 scheduled tasks task1 , task2.
  2. task1 runs batch_file_1.bat , task2 runs batch_file_2.bat
  3. task1 start either automatically or manually. completion of task1 should trigger start of task2.
  4. so, task2, have created 'on event' trigger following xml in xpath form:
<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> 
  1. when run task1, task2 starts running before task1 completed.

    reason : batch_file_1.bat has start "" command in starts new command screen. start "" command executed in task1, task2 starts running.

how stop task2 starting when task1 starts new command window (start "" command in task1) , trigger task2 when task1 completed?


Comments