23

I am trying to set up a task that will start up an .exe every minute.

I have created a Trigger, that when triggered will run the .exe and repeat every minute indefinitely. (I have also tried creating a daily task, the once triggered will repeat every minute for that 1 day).

When I run the task manually, it works as expected, but if I leave the task to reach the 'Next Run Time' instead of it running and updating the 'Last Run Time', the 'Next Run Time' is updated to run a minute later and the 'Last Run Time' remains the same.

I have checked the Task History and there are no new events. Also, I have logging within the specified .exe and it's not showing that it has been run.

Overview

Edit Details

Settings

Settings

10
  • Check the event viewer in case it is crashing. It could be running in the background, so you do not start a new instance? Check Task Manager to make sure the exe isn't running
    – Dave
    Jan 15, 2015 at 12:08
  • @Dave It doesn't appear to be running in the background and I can't see any logs in the Event Viewer for the Task Scheduler. Do you know if the .exe has to be in a specific location or something like that?
    – Jack Allen
    Jan 15, 2015 at 14:14
  • No, the .exe can be any where. However, the exe could be crashing or similar so I thought to check event viewer. What is the application? One you wrote or 'other'?
    – Dave
    Jan 15, 2015 at 14:17
  • The .exe is something I have written, although I have run it both on the server from its directory location and also I have manually run the Task in the Scheduler and the .exe runs successfully.
    – Jack Allen
    Jan 15, 2015 at 14:20
  • Does this issue occur when you're logged onto the server?
    – Dave
    Jan 15, 2015 at 14:21

7 Answers 7

19

Just in case you trigger the task manually...

I have just come across this same problem on Window 7. I haven't tested it with any other version of Windows.

It seems that repeated tasks are not executed when run manually (right click on a task and then select "Run").

When run manually, the task will run only once and that's it!

This is a trip wire since it's natural that people simply run the task manually right after its creation to check whether it's working as expected.

What you could do, set the trigger to "At startup". After you rebooted the machine, the task should then be in the "Queued" status. This means it will run at the configured interval.

4
  • A better solution via @user917170 is to check 'Run task as soon as possible after a scheduled start is missed' with whatever trigger you want (time based, etc). Then it should start running automatically on schedule as expected.
    – drzaus
    Feb 11, 2019 at 13:58
  • This is not correct. Repeated tasks work well even on a manual start if the start date and time of the Trigger is set prior to the manual start date and time. See answer of IdontCareAboutReputationPoints. Even the prior suggestion does not start the series otherwise.
    – sdittmar
    Jun 26, 2020 at 7:41
  • @sdittmar This is not incorrect. It's a different way of addressing the problem.
    – quat
    Jun 29, 2020 at 22:09
  • A task scheduled with the auto-repeat feature will continue running on auto-repeat even if the user starts it manually at any point. What DOES kill the auto-repeat feature is modifying the task's trigger (in my case it was changing the auto-repeat period).
    – alex_223
    Nov 22, 2022 at 2:54
5

I ran into this problem me too, I was able to solve it by setting the start date and time one or two minutes ahead of the time of making the task to trigger the action and start repeating it as configured.

1
  • This here is the correct answer when using a manual start. The repeat series will only trigger when the start date/time of the Trigger is set prior to the manual start - which makes sense, doesn't it? When you set up a new task you often use a date in the future. That is why I also run into the same problem as the OP. This answer solved it.
    – sdittmar
    Jun 26, 2020 at 7:37
5

The correct way to set this up is to set the start time any time in the past, then select "Run task as soon as possible after a scheduled start is missed" in the Settings tab.

0
5

I fought with this non-sense for an entire day, scouring event logs and triple-checking permissions, and the only logical conclusion is that Task Scheduler shows the Next Run Time incorrectly when you create or modify a task's Trigger and that Trigger's START date/time is in the past (a bug that, 5 years later, remains unaddressed - the fact that Task Scheduler's Help/about reveals that this program is still at version 1.0 is quite telling).

In my case, I had a task scheduled to start at 8:00 am every day and repeat every 30 minutes for a duration of 1 day. The task had been running OK until I touched it to change its frequency to every 5 minutes. Once I did this, Task Scheduler would update the "Next Run Time" every 5 minutes, but the task would not start at all.

Based on the behavior I observed while analyzing this to death, Task Scheduler should show the Next Run Time for my task as tomorrow at 8:00 am, as opposed to the next 5-minute interval.

I worked around this issue by adding a new trigger that was to START a few minutes from the current time and leave the existing trigger (start at 8 am and repeat every 5 minutes) alone. The problem with this approach is that if I want to modify the task and delete this temporary trigger, as soon as I'd do this, the task would stop repeating. I imagine that everything would go back to normal the next morning at 8 am, as the task is scheduled to run.

The task is also scheduled to start "as soon as possible after a scheduled start is missed," but restarting the Task Scheduling service, as indicated in this thread's second reply doesn't get the repetitions going because at 8 am, today, this scheduled task already ran.

Disabling and enabling the task and/or the trigger doesn't make it start auto-repeating. Exporting, deleting, and importing the task again didn't work either. Even importing it with a different name doesn't convince Task Scheduler to start repeating the task.

Unfortunately, regardless of how absurd this is, the only option, if you don't want to add a second trigger - and want to keep your task scheduled to start at 8:00 am - is to wait until the next day.

3

I just ran into this problem while trying to migrate scheduled tasks from my home PC (Windows 10 Pro) to a server (also running Windows 10 Pro, freshly installed via Microsoft's media creation tool). The migrated tasks simply would not repeat. What ended up working for me was changing the Trigger from 'Daily" to "One time".

Screenshot

1
  • thanks, this worked for me on windows server 2019
    – azote
    Sep 14, 2023 at 1:25
2

Manual triggering is for testing. You need a real trigger to start repetition.

I solved this by setting up a trigger for system start, as suggested, but if that session fails or you make edits, and you don't want to restart the machine, just set an additional trigger to perform the same sort of repetition on a daily basis, with a start time in a minute or two.

You can then leave both triggers running, and set them both to not start another instance if one is already running, with appropriate timeouts to kill the current instance if it runs too long. This way, you are assured of triggering, even if the instance that started when the computer was last rebooted dies.

2
  • Creative solution. I am going to give this a try. Aug 7, 2017 at 15:47
  • Better: enable 'run as soon as scheduled start missed'. In general, be wary of multiple triggers for two reasons -- exporting a task w/ an end-date on a trigger, importing won't respect the end date and both will be active. Also, there was a hotfix for some Windows ([KB2461249|support.microsoft.com/en-us/help/2461249/…) because the scheduler would double-schedule a task if the start time coincided with the end of a window, so I could imagine some weird rounding causing multiple overlapping triggers to fire.
    – drzaus
    Feb 11, 2019 at 14:09
0

I discovered a bit more specific of an answer to this conundrum. The short version is that you need to set tasks as "One time" rather than "Daily" if you want them to resume one interval after being re-enabled. If they are set up as "Daily" they will ignore the Repeat interval until the Start time comes around again.

The more complete answer is here:

https://superuser.com/a/1819607/52280

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .