24

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

7 Answers7

23

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.

quat
  • 471
6

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.

6

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.

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.

alex_223
  • 106
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

jaydeel
  • 31
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.

music2myear
  • 49,799
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