Windows 10: Task Scheduler "Missed task start rejected" - windows

I have a task in Task Scheduler which runs notepad with the sole purpose of waking the computer at 5am Tues-Sat. Usually it works fine. But every so often (something like once a week) it does nothing. If I look in the Task Scheduler history I get:
Event ID 153
Task Category = "Missed task start rejected"
General = "Task Scheduler did not launch task "\Dr Bobs
tasks\Portfolio Update" as it missed its schedule. Consider using the
configuration option to start the task when available, if schedule is
missed."
Any ideas why it occasionally misses the task? I have tried changing settings such as "If the task fails, restart every minute" to no avail.
Running on a desktop, Windows 10 Home 64bit.

I have worked this out. If I use my Android phone to put the PC on standby, using an app called PC Remote, then I get this problem. If I put the PC to sleep directly via Windows then there is no problem.

Related

How to run a batch file at a specific time and kill it once it runs for a number of hours

I have a bat file which I run with an externally given parameter. It should run for about 6 hours and if the task is still not finished, the process should get killed. I can start the task using Task Scheduler but I'm not sure how to kill it once it reaches the set number of hours. Any idea how I can achieve this?
Thanks.
In Windows Task Scheduler use "Create Task" (not "Create Basic Task").
On the Settings screen there is the option labelled "Stop the task if it runs longer than:".
You can override the length of time.

Windows Task Scheduler wont start task because it thinks previous version is still running

I have an occasional problem (maybe twice a month) were windows task scheduler won't start a new task because it thinks the old version is still running.
The task is a powershell script, it runs all day, every day. The task scheduler starts the script at 5 past midnight every day (UTC), and then the scripts exits itself everyday at 23:55 (UTC). The script does the following actions.
logs its own startup in a database
spends all day reading records from a remote server.
logs its own shutdown at 23:55 every night and exits with 'exit 0'
Task scheduler runs the script with the -NoExit option, so the powershell console remains open on the screen even after the task has exited (allowing a visual check of any output generated)
This all works fine 95% of the time, however, occasionally when the task scheduler attempts to start the new task at 00:05 I see the message 'Launch request ignored, instance already running' in the history. But when I check the log records from the powershell script I see that it started and finished at it's normal time, and I can double check this against the console.
Curiously, on these occasions the task scheduler history indicates that the blocking task finished at about 8am - a time which always corresponds to when I logged on that day.
Any suggestions on what's going wrong and how to sure it? I've already tried tweaking some of the task settings "if the task is already running then the following rule applies - stop the existing instance" but because the fault is intermittent, it's very hard to pin down.
Update - following further testing.
I've tried creating 100s of similar tasks and running them with similar conditions. So far I've reached two conclusions, firstly everything seems to work OK if I remove the -NoExit option. It's almost as if the scheduler has trouble differentiating between the command window, and the PowerShell script itself.
Secondly, everything seems to work ok if increase the gap between the previous schedule dying and the new one starting from about 15 minutes to half an hour or longer. It's as if the task scheduler takes time to work out that the old task has stopped.

Issue with windows tasks scheduler

I want to run powershell script every day and want to use task scheduler for it. But I have to be log in because this srcipt runs cisco vpn client and putty and then runs some python script for one minute. I don't want it to interrupt my work (because it swichs to different vpn etc.) so I set up time to run this task to 2:00 AM and check "run asap after a scheduled start is missed" to make sure that this task will run every morning after I turn on my computer.
But the problem is, that it doesn't run the script after turn on PC and it says event id 332 - Launch condition not met, user not logged-on. I think I understand this problem, it tries to run this script right after start up so at time I'm not log in. But why does not the task try it after 1 minute again up to 3 times? (see below)
What shoud I do to make sure that it will run every day after turn on PC but only once a day (sometimes I need to restart my PC so I don't want it to run again)
There is my task configuration:
Check the 'Run whether the user is logged on or not' and 'Run with highest privilege' options.it will work for you.

Issues of Jenkins build scheduling on Windows: delays in the execution of scheduled builds

My company installed Jenkins as a Windows Service on a VM with Windows 7 Professional. We scheduled 3 tasks for the night: one at 6.00, one at 6.10, one at 6.20. By looking at Jenkins logs, we saw that all the 3 tasks where delayed to around 7.20.
By looking at the Windows Event Viewer we discovered that the machine used to go to sleep mode after 30 minutes without activity (this is set in the Power Options of the Control Panel ).
Anyway, some windows scheduled task was waking up the machine (namely, some windows service for synchronizing the clock) every some time. By chance it was waking up at 7.20... As a consequence, also Jenkins was able to complete its tasks scheduled for one hour before.
Question: Do you know a better way to fix this other than disabling the "Put computer to sleep" option?
First - there is the obvious answer. Don't let the Jenkins server go to to sleep.
But there might be reasons for it. Personally, I have my own Jenkins server sleep during non-work hours. To get my server to wake up at the beginning of the day, I scheduled my own task in the Windows Scheduler that would wake the computer up 10 minutes before the first scheduled Jenkins task. The task could be anything, but the important part was flagging it to wake up the computer.
To go back to sleep at the end of the day, I have a Jenkins job that is set to trigger at the end of the day. The Job is a Windows Shell command "%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState Standby" that puts the Jenkins server back to sleep.

How to run a windows scheduled task 20 mins after system startup?

In windows scheduled tasks properties, you can only choose "at system startup" without being able to assign a specific delay such as 20 minutes, so I wonder how can I setup a schedule task if I want it to run after the system "fully" starts up(you know how fast this can be in XP)? Hope you guys know the answer. Thanks
Create a scheduled task to run an app you've written, have the app you've written sleep for 20 minutes and then run the original app.

Resources