Showing posts with label scheduled tasks. Show all posts
Showing posts with label scheduled tasks. Show all posts

Wednesday, August 4, 2010

Windows Service Vs. Scheduled Task

Windows Service
  • Interval specific, i.e. you can create a timer that runs every 4 hours etc
  • Runs all the time.
  • You can set up listener events to push actions
  • No GUI. Any interaction will be carried out via EventLogs, counters and such.
  • Runs in own security context, i.e. does not need to care which user logs in etc.
  • More reliable?
Scheduled Task
  • You can specify exact timing, e.g. 8pm every Wednesday.
  • There is a console to display output messages.
  • You can run the application based on logged in user.

Monday, July 13, 2009

Scheduled Tasks using Windows Service

1) Create a new Console Application (WindowsScheduledTask) using Visual Studio .NET.
- This console application contains the code for your scheduled task
- Example: Archive database records, Send email alert
2) Go to Windows Start -> Control Panel -> Scheduled Tasks.
- Clicking Add Scheduled Tasks will launch the Scheduled Task Wizard
- Click on “Browse” to add the scheduled task application (WindowsScheduledTask.exe)
- Set the scheduling properties
3) You can set advanced properties for the task by checking the box at the last segment of the wizard.
- Check “Show multiple schedules” to run the task more than once a day
- You can also set the start date and end date of the task