Some tome we need to do a task periodically. Suppose we want to transfer file from one location to another location periodically. For this we can developed an windows service or console application. This article describes how to run an application in windows task scheduler. Summary of the article:
- Creation of C# Console Application
- Creation of Windows Task Scheduler
Creation of C# Console Application
At first we need to create a console application in C#. Write the desired code to fulfill the requirements. Then compile it. After compilation some dll or exe files will be generated in Bin folder. This dll or exe files will be used to make a Task in Windows Scheduler.
Creation of Windows Task Scheduler
The steps to create a windows task scheduler is given bellow:
Log on as administrator.
Make a folder or directory [ConFile] in the hard disc and copy all the dll or exe files of console application from Bin folder.
Open Task Scheduler by either typing “task” on the Start Menu search bar, or by opening All Programs –> Accessories –> System Tools.
Two options are available to create windows task “Create Basic Task” and “Create Task..”. We can follow any one of them.Both are almost same [Create Task some some advance options]. Here we will follow “Create Basic Task”.
Select “Create Basic Task” from the right hand pane and the Create Basic Task Wizard will open.
Type a “Name” and “Description” [ConFile] for the new task and click next.
Select when you would like the event/task to run and click next. Here we will select daily.
Select the exact time when you want to run the application and click next.
Select action and click next. Here we will select Start a program.
Click “Browse” and select the exe/dll file form the [ConFile] folder and click next.
New the task has been created and will be run at the specified time. Click “Refresh” and new Task [ConFile]. This Task will perform according to the functionality of console application.
We can change our task settings at any time, just double-click the task name.
We can also delete the task just clicking the “Delete” button in the right hand pane.
In this way we can make any application automated. That’s all about windows task scheduler.