Run task scheduler task 5 min after specific task starting - windows

Is there any way to start task after sometime when specific task starts?

Two answers:
Put the task in a batchfile, add a wait for 5 minutes and then put the next task.
In the task scheduler, instead of the task itself, refer to the batchfile.
I just see there's something called INotify cron (there's a tag icron for that). Maybe this can help you.

Related

Schedule Powershell script to run every hour

Please check this picture as following
I was looking at Window task scheduler to schedule my script to run each hour. The script will do some checks and will send an email .
I did not find options to schedule it for each 1 hour. I only found for every day, daily, weekly and so on.
Task scheduler does show the option to configure hourly trigger as shown below.
Another option you have is to run your PowerShell script as a Service and add the logic in your PowerShell script to trigger your main code once every hour.
Refer: Video: Running PowerShell scripts as a real Windows Service!
How To Create a User-Defined Service
Call it from scheduled task eg task would be to start PowerShell and run the specified script see Run a powershell script in the background once per minute
create the task then -> new trigger -> daily -> repeat task every hour is one way of doing it. Or do it on commandline

Bat File return code to fire off a task w/ task scheduler?

Is it possible for the windows task scheduler to read the return code of a batch script and to fire off a task based on the value of said return code? I have a batch script that:
copies files from one drive in server A to another drive in server B.
If server B is down it'll complete with a return code 1
and I want the task scheduler to see that return code of 1 and send an email saying there's something wrong with server B.
It's clear in the task scheduler it sees the return codes but I can't seem to find an option to use the return code.
Another idea I've thought about is have the task scheduler send an email if a task fails after starting up. But it appears even when the batch file returns a 1 for a failed copy, the task scheduler still marks the task as ran successfully.

windows scheduler to run batch file after the first process is ended

I have a small question on windows scheduler - Say i have scheduled a task to run once in 30 minutes interval in windows task scheduler.
Does windows start the second process even if my first job process has not finished yet? Or windows takes care of starting the second job process only after the first job is finished? Or do i have to take care of it explicitly?
Go to the Settings tab in the Create Task wizard (or editing the tasks’ Properties). There should be an entry If the task is already running, then the following entry applies: and you can choose one of the following options (push button):
Do not start a new instance - the first instance of the task continues to run.
Run a new instance in parallel - the first task instance continues to run and the new task instance also starts.
Queue a new instance - the new tasks instance runs after the first task instance finished.
Stop the existing instance - the first task instance is stopped and the new task instance is started.

Windows Task Scheduler API 2.0 make task miss (only)next scheduled time

While using the Windows Task Scheduler API 2.0, how does one set or unset the option: "run task as soon as possible after a scheduled start is missed". I have already create multiple types of tasks using the API in c++, but I can't seem to find where you set this option...
I guess I found it: StartWhenAvailable .
I also would like to be able to run the task on demand within the api code.
I think I allow on demand running using: put_AllowDemandStart but how do I run it from withing the code?
I guess this is it : IRegisteredTask::Run
But... How do you make a task miss its next scheduled time?

Windows Server 2008 Task Scheduler - execute job as group

I want to set up some jobs in our task scheduler. Problem is that we do not want to use a user as run as user but an ant-group.
Is that possible?
I haven't found any documentation on this specific subject, some of the here say it has to be a user, others say it looks as if a group may be used.
As far as I know you can do it, by assigning a group to the task
Check this

Resources