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.
Related
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.
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.
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.
i am trying to make a program run for 13 hours every 7 days and then the program will stop and the task will end. However i may turn off my computer during that time and then do you know if when i start the task again the timer will resume?
for example
i start my task it runs for 5 hours i then turn off my computer.
next day i turn my computer on and the task starts and runs for 8 hours
then...
will the task end becasue it has reached 13 hours or will it continue to run till it reaches 13 hours?
is there a way to make the timer resume whenever i turn my computer off or do you know of any program that will do this
any help would be appreciated thanks
To some degree, it depends on the operating system your computer or mobile device runs. If you are running Windows 2000+ or a UNIX derivative (Linux, BSD, OSX), we have use of tools like cron to start us off. If it's a mobile device, we have a bit more work to do.
I'll assume you have a Windows or UNIX device to start. Therefore, you have the Startup/init.d layers of the OS to kick things off when you begin. This is used just to fire things off at power up. We might, for example, write a shell script/WSH script that, at login/startup, runs your up. At this point, you are running, but we want to do a bit more.
Since your app can now be started by the system, we need to make sure it stays running and is restarted if necessary, even if the system is not rebooted. For example, it could be killed/terminated by other events. Our goal is to start your script up at system start, and ensure it runs for 7 hours. Assuming UNIX/Linux:
This can be done with two tasks:
One task just ensures that we've run at least every seven days
The other task ensures when we run, we run for seven hours and no more.
Our first task is a pair of cron scripts. One runs ever 30 minutes. It's sole task is to check to ensure the main worker task is either running or finished. If it's not finished, and it's not running for some reason, start it. The second cron task runs every seven days and when run, cleans up the markers from the worker task.
Our main worker task, when run, splits its workload into 30 minute segments. It runs each segment, and leaves a "breadcrumb" in temporary storage somewhere -- basically, it says "I've done another 30 minutes of work". When it has 14 crumbs, it's done.
How this all works:
Cron or init.d starts up the main worker thread
THe worker thread runs, hopefully to 14 "chunks of work" and terminates.
Each week, the other cron tasks check to see if we had 14 chunks. If we did, it was a successful run. Remove them and start over. If not, restart the worker task.
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.