Articles → .NET WINDOWS SERVICE → Schedule Console Application Like Windows Service
Schedule Console Application Like Windows Service
Create A Console Application
File.WriteAllText(
string.Format(@ "c:\temp\Files\{0}.txt", System.Guid.NewGuid()),
string.Format("Files written at {0}", DateTime.Now)
);
Schedule An Application
- Open windows task scheduler (Start – All Programs – Accessories – System tools – Task Scheduler).
- Click on Task Scheduler Library
- On the right hand side click on ‘Create Task..’ (See the following screen shot)
Click to Enlarge
Click to Enlarge
- Enter the name and click on ‘Actions’ tab. Following screen will come
Click to Enlarge
- Click on ‘New…’. Following window appears.
Click to Enlarge
- From the Program/Script section select the exe file and click on Ok (Button will be enabled when you select the exe file)
- Go to Triggers tab and click on ‘New..’ button.
Click to Enlarge
- Popup window appears. In the popup window, select the checkbox ‘Repeat task every:’ and select the frequency as 5 minutes.
Click to Enlarge
- Click on Ok to close the popup window and again click ok to close parent window.
Output
Click to Enlarge