0

In the Linux world, the simplest way is to use a Cron job. There is no Cron in Windows. There is however Services, but that seem to be a lot of work. What is the simplest way so a set of commands will run every 5 min or so?

To be more specific, the commands I need to run consist of moving some files, and updating a database. Possibly written in C# so it's slightly more complicated than just a BAT script.

Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
Bill Software Engineer
  • 7,362
  • 23
  • 91
  • 174

3 Answers3

4

Task Scheduler is probably the best way to go, though an alternative is http://cronw.sourceforge.net/ It runs as a system service and only requires perl.

kalikid021
  • 210
  • 1
  • 6
  • Sounds good, I'll accept this answer in 10min after it becomes available. – Bill Software Engineer May 18 '12 at 16:02
  • Task Scheduler is certainly the best way to handle this natively in Windows (though there are, of course, alternatives). You can do a large array of stuff including having a service run at set intervals as well making the service run at Windows start-up (before a user logs in). – Christopher Jones May 18 '12 at 16:13
0

You can ofcourse run C# executables from batch files or even directly from Task Scheduler. Open Task Scheduler and enter the path of your executable and configure it to run every 5 minutes. Make sure that appropriate version of .NET framework is installed.

Soundararajan
  • 2,000
  • 21
  • 23
0
  • Quartz.NET – This is a very complete cron job library. By far it has the most features.

  • NCrontab – This is a simpler library that implements a cron scheduler (no cron job).

For details see a link.
http://blog.bobcravens.com/2009/10/an-event-based-cron-scheduled-job-in-c/
and this question of SO also help You.
What is equivelant of CRON jobs in ASP.NET - C#

Community
  • 1
  • 1
4b0
  • 21,981
  • 30
  • 95
  • 142