11

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

  • 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 '15 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 '15 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 '15 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 '15 at 14:20
  • Does this issue occur when you're logged onto the server? – Dave Jan 15 '15 at 14:21
16

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.

  • 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 '19 at 13:58
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.

  • Creative solution. I am going to give this a try. – Rod Hartzell Aug 7 '17 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 '19 at 14:09
2

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.

1

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.

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.