Basically, the problem with the just the timer is: you usually cannot guarantee that the timer setting is remembered for days, 24 hours per days, because you cannot guarantee that some application is executed all the time. But to hold a timer, you need some application running all the time. The adequate form of such application would be
Windows Service. But you don't need to write your own Windows Service.
The Service you need already exists, called
Windows Task Scheduler, see:
http://en.wikipedia.org/wiki/Task_Scheduler[
^],
http://msdn.microsoft.com/en-us/library/aa383614.aspx[
^],
http://msdn.microsoft.com/en-us/library/aa384006%28v=VS.85%29.aspx[
^].
See the last link above for use of the Windows Task Scheduler. You can use its API in your program using
Task Scheduler Managed Wrapper, see
http://taskscheduler.codeplex.com/[
^].
But if can be even simpler. You can use Windows Task Scheduler using Windows utilities AT.EXE or SchTasks.EXE, see:
http://en.wikipedia.org/wiki/At_(Windows)[
^],
http://technet.microsoft.com/en-us/library/bb490866.aspx[
^],
http://en.wikipedia.org/wiki/Schtasks[
^],
http://msdn.microsoft.com/en-us/library/windows/desktop/bb736357%28v=vs.85%29.aspx[
^].
And you don't need to write your own Windows Service.
The Service you need already exists, called
Windows Task Scheduler, see:
http://en.wikipedia.org/wiki/Task_Scheduler[
^],
http://msdn.microsoft.com/en-us/library/aa383614.aspx[
^],
http://msdn.microsoft.com/en-us/library/aa384006%28v=VS.85%29.aspx[
^].
See the last link above for use of the Windows Task Scheduler. You can use its API in your program using
Task Scheduler Managed Wrapper, see
http://taskscheduler.codeplex.com/[
^].
But if can be even simpler. You can use Windows Task Scheduler using Windows utilities AT.EXE or SchTasks.EXE, see:
http://en.wikipedia.org/wiki/At_(Windows)[
^],
http://technet.microsoft.com/en-us/library/bb490866.aspx[
^],
http://en.wikipedia.org/wiki/Schtasks[
^],
http://msdn.microsoft.com/en-us/library/windows/desktop/bb736357%28v=vs.85%29.aspx[
^].
—SA