I am trying to set up a schedule task to run an exe exactly once a day. I have tried the following:
Trigger daily 4:00AM, "run task as soon as possible after a scheduled start is missed"
This approach works perfectly if I don't have a password set on my account, in which case Windows boots directly to the Desktop - after a short delay, the task runs.
When I added a password to my account, the task no longer ran. In the task history I see warnings being logged:
Task Scheduler did not launch task "X" because user "Y" was not logged on when the launching conditions were met. User Action: Ensure user is logged on or change the task definition to allow launching when user is logged off.
This seems like a stupid warning - under the "Security options" I have "Run only when user is logged on" selected. Why is Task Scheduler trying to launch the task before the user logs on?
Trigger daily 4:00AM and "at log on", run as soon as possible
This approach did not have the effect I intended, i.e. I wanted both conditions to be true, i.e. if "after 4:00AM daily" is true and "log on" is true, then run the task; and for each successive "log on" event that day, the "after 4:00AM daily" won't be true so it'll wait for the next day. This is unfortunately not how Task Scheduler works, and with this approach, the task runs after every log on.
Run whether user is logged on or not
I cannot use this approach because the exe I'm trying to run sometimes requires user input when it is complete. In general, there are a variety of reasons one might not be able to use this option.
In the realm of desperate workarounds, I am considering writing a batch script that will write out to a file and be able to detect if it's been called before.
Surely there must be a better way to achieve this seemingly common and simple scheduling use case?