3
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.
Other options
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?
@1Fish_2Fish_RedFish_BlueFish It's a deprecated backup program called VersionBackup. Basically it runs with a window that displays progress and at the end of the run pops up a window if there were any problems. Unfortunately it has no documented command line options. On Windows 7 it had some built-in way to only run itself once a day but since upgrading to Windows 10 this no longer works. So if it runs a second time, it repeats the backup process. – Jim – 2016-02-01T22:24:35.847
Well then you may be able to just create a simple batch script, put some logic in it to first check for a "check" file that may be called something like
VersionBackup_20160201.txt
and if it does NOT exist, create it, and then run the app. If it DOES exist, then DO NOT run the VersionBackup.exe and exit. This way you ensure per day e.g. <YYYYMMDD> that it only runs once and creates that file just before it runs. If you're intested, I have an example script logic I'll add as an answer if you think it'd potentially be a solution you could use or at least test with perhaps? – Pimp Juice IT – 2016-02-01T23:51:47.833Also in addition to my above comments, can you tell me if this is the site and software you use, and which configuration you use if so (e.g. the client and server, the master, etc.)? http://www.sb-aw.com/download.html
– Pimp Juice IT – 2016-02-01T23:54:25.157@1Fish_2Fish_RedFish_BlueFish Thanks, that would be useful. The site you found is correct, I am using the "master" version, which is their non-enterprise, consumer tool. – Jim – 2016-02-02T07:23:36.347