Scheduled task remains running, when run manually


  1. Posts : 149
    Windows 7 Ultimate x64
       #1

    Scheduled task remains running, when run manually


    I have several tasks defined in the Task Scheduler. They're all working fine. They are written in the REXX language (about the only language I'm proficient in).

    Yesterday, I made a small change to one of the scripts and ran it manually, from the Task Scheduler (to ensure that it ran correctly in the scheduler environment).

    The script ran to completion, but the status remained "Running". I've spent the last 24 hours trying to work out why the task sticks at "Running", only to discover that closing and re-opening the Task Scheduler makes the status revert to "Ready".

    It looks like the Task Scheduler is not updating the status, when the program exits. Is there anything I can do about this (I suspect the pragmatic answer is "ignore it").

    Are my scripts supposed to do something to signal to the scheduler that they've terminated?
      My Computer


  2. Posts : 1,049
    Windows 7 Pro 32
       #2

    There is probably nothing wrong from what you describe. Pressing F5 or Refresh from the Actions pane does the same thing as re-opening Task Scheduler. I've noticed the same thing and it seems the Task Scheduler GUI is just not updated so you have to do it manually.

    If your scripts automatically terminate the process when they've finished then the only thing you might want to do is set an proper exit code (if you want). This can be seen in Task Scheduler in the column "Last Run Result" for every task. For windows batch files this is how to do it: Exit - Terminate a script | Windows CMD | SS64.com
    0 is the default exit code. If I terminate a batch file with Ctrl+C it will instead show 0xC000013A as Last Run Result.
      My Computer


  3. Posts : 149
    Windows 7 Ultimate x64
    Thread Starter
       #3

    Thanks, Tookeri

    Now my only problem is remembering that F5 is "Refresh". As far as I can see, there's nothing to tell me. It would be nice if there were an entry under "Actions" such as "Refresh (F5)" to remind me.

    Perhaps my browsers will help me. I've always used Ctrl+R to refresh/reload webpages; now I can use F5 instead. Wonderful!

    I like to learn something new each day, and here it is, 06:50 in the morning and I've already got my new fact for the day. :)
      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 03:01.
Find Us