Setting up a scheduled task in .Net

I read a few posts here in StackOverflow about scheduling tasks, but I'm not sure if everything is correct. I am encoding (in VB.Net) a backup application that I would like to add as a scheduled task (in fact, I just want the user to decide to run it every day, for example, 3 AM).

I read posts suggesting using the Windows service for this, but that sounds a bit for something as simple as running a task periodically, right?

Could you advise me how easy it is to set up a scheduled task in VB.Net? I try to keep my code as light as possible.

+6
scheduled-tasks scheduling
source share
2 answers

It’s best not to write a scheduler, but to use the built-in Windows scheduler to run your code.

Additional Information:

http://support.microsoft.com/kb/308569

Note. If you plan to run the task under an account other than yours, the application may not have access to network drives or other resources. In other words, there may be some security issues for the job, especially for something like a backup application.

If this is just a personal backup application, I would recommend using XCOPY from a batch file rather than reinventing the wheel.

+4
source share

As RichardTallent says, don't write your own; connect to the Windows scheduler instead. This is not too complicated.

We used libraries and examples here and here . Easy to use. Kudos to Eduardo Morchillo and Eric Moro for showing the way.

+1
source share

All Articles