Task Scheduler wait for action to complete


  1. Posts : 37
    Windows 7 64bit
       #1

    Task Scheduler wait for action to complete


    Hi-

    I am using Task Scheduler to run an .exe and then a .bat file at a scheduled time each day. However, the run time for the .exe process varies between seconds and hours and I need to be sure that the first process is finished before the second Action (.bat file) is initiated by Task Scheduler. Can this be done in Task Scheduler? Appreciate any suggestions.

    Thanks,
    JonnyB
      My Computer


  2. Posts : 17,796
    Windows 10, Home Clean Install
       #2

    Take a look at the scheduler. Are there any conditions that would cause the .exe to change times, ie. only if not used or only if user is logged on.
      My Computer


  3. Posts : 9,582
    Windows 8.1 Pro RTM x64
       #3

    Why not combine them into a single batch file?

    Code:
    @ECHO OFF
    start <path><filename>.exe
    {Your original batch file}
      My Computer


  4. Posts : 37
    Windows 7 64bit
    Thread Starter
       #4

    Thanks for the replies.

    Richc46 - I'm not sure that I follow you perfectly, but I don't believe there are any of those conditions present.

    Dwarf - I think that makes the most sense, but I have two arguments that i supply the .exe from the "Add Arguments" task scheduler field and I'm not sure how to pass them if I use a batch file.

    The arguments are: autoupdate=1 autoclose=1

    Here is what I have so far for code in the new .bat file...if anyone has suggestions on how to get the above arguments to the DataUpdater.exe I would appreciate it.
    Code:
    cd C:\TrApps\
    start /wait DataUpdater.exe
     
    cd C:\Desktop\
    start RunABAuto.bat
    Thanks again for your help.
      My Computer


  5. Posts : 9,582
    Windows 8.1 Pro RTM x64
       #5

    I'll have a look at this, and report back later. I'm sure that there is a way to link 2 or more scheduled tasks in such a way that the completion of one automatically starts the second (and so on).
      My Computer


  6. Posts : 37
    Windows 7 64bit
    Thread Starter
       #6

    Sounds good Dwarf...thanks again for your help with this.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 23:41.
Find Us