Should I end a task-scheduler task after processing is finished?


  1. Posts : 2
    Windows
       #1

    Should I end a task-scheduler task after processing is finished?


    Via task scheduler, I start a program that runs some calculations and closes itself when finished.
    But the task in taskscheduler is still "running" instead of being back to "ready". I have seen that this blocks other tasks from writing to a file created by the first program.
    How is task scheduler intended to use? Always end a task after your processes are finished? Or just ignore that the task is "running" much longer than needed?
      My Computer


  2. Posts : 7,607
    Windows 10 Home 20H2
       #2

    Press F5 to refresh it after the processes are finished.
      My Computer


  3. Posts : 16,950
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #3

    Task scheduler [TS] is a real pig about this.

    TS immediately changes the state to Running but it needs a manual Refresh to update the status afterwards [probably to Ready].
    - So either Refresh as Matthew says, or
    - Close & re-open TS.

    If, when you Refresh, the task is still Running but you believe that it has finished then that would be a TS fault that needed investigating.
    If, when you Refresh, the task is Ready but those other tasks cannot get access then that is a problem outside of TS. That would need a different investigation.

    Do you have a method for determining if your 'program' has finished and closed?
    - Might it be missing a Close command?
    - You haven't said what sort of 'program' it is so I cannot speculate about it.

    Denis
      My Computer


  4. Posts : 2
    Windows
    Thread Starter
       #4

    Thank you Matthew. F5 does the job. That is a somewhat surprising behavior of taskscheduler. But ok. Thanks Denis, I set an extra quit() in the end of the r-script, but thats not necessary, r closes anyway. Indeed, that case, when a file was occupied by an other process has to do outside of this task. I just want to be sure all closes and cannot produce any conflicts. Thats the case now and verified with a TS
    refresh.
      My Computer


 

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

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




Windows 10 Forums