This is an Often scenario for .Net stack developers (really?); not so often, but sometime we get a requirement where we want to run an executable file repeatedly. Let me call it TASK(running executable file repeatedly ) as task seems more like what suits a developer’s blog.
We need basically 2 things in this case:
- An executable programme that you want to run repeatedly.
- Task Scheduler(it comes with your windows operating system)
Now let’s see how it works:
Open Task Scheduler on window’s machine.
Click on Create task….
It will open window having multiple tabs and selected tab as “General” by default. So we will go tab-by-tab and see how to configure it.
This tab collects some basic stuff about the task we are going to create.
(Name for the task and a small description for it).
Trust me other than developers can not understand(sometime after 1 appraisal the developers too can’t) what this task does by name only. So please put a layman friendly description for the task.
There are also some security options and we can decide over those as below:
- Which user account to be used while running the task.
- Whether task shall be run only when user is logged on
- And setting the privileges for the task
If you are not so familiar with those you can ignore security option section and can move to “Triggers”
Trigger tab is actually what we want to do with the executable file. i.e. schedule it to run repeatedly. Its an easy interface where user can define whether he wants to run the task. There are some basic setting to repeat the task.
- One time
- Weekly(this gives the option for selecting various days)
And some advance settings to repeat task for every 1 Hour/ 5 Hours/ 1 Min/ 5 mins… etc.
User can also define if task should stop if it does not complete in a timespan.
And the most important expiry date(in case of medicine only, if you live in India) for the task.
Move to Action tab where user defines what shall the task do when it is triggered.
There are 3 main options and user will get settings as per the selection. In this example I chose Start a program and provided the path for program to execute.
If in case your program needs some additional(external) arguments you can set it from this screen.
This tab asks user to choose some conditions that works in combination with Trigger and decides whether task should run. If any of the condition defined on this screen is not true, task will not be triggered.
These conditions are mainly system level conditions, that general user should not worry about.
Some basic settings about the task like:
- To start the task as soon as possible if it somehow missed the scheduled start.
- Whether to restart the task if it fails once or manytimes
- When to stop the task if it keeps running
- And to delete the task if is not running since a time span.
- And last but important point, whether parallel instances allowed for same task?(You will find this useful when you have to trigger the task after some seconds. But How to do that??)
I keep it disable personally. If you keep it enabled, it will log the task task detail under this tab.
Cheers if you find this useful else go to Off Work.