Hugo Migneron
Hugo Migneron

Reputation: 4907

Executing an application after a period of time

I'm writing a small app that needs to be executed once a week. I could write it as a service that runs constantly but only executes the task that I need it to once a week, but that seems like overkill.

Is there another way of executing an application once every x period of time? I'm looking for a solution that doesn't involve user interaction.

Upvotes: 1

Views: 706

Answers (6)

Rob
Rob

Reputation: 655

If you need full control on the process (result values, parameters to be provided, etc), I would suggest you to create your own task scheduler, where you can use the cron algorithm to schedule the time you want execute your task. I know it may sounds overkill to create a service to run once a week, but if you make a generic scheduler, you will be able to reuse your schedule for other purposes.

I created this scheduler in the past, and it has been used for years in production. I implemented the cron algorithm in .Net, based in the open source algorithm that one developer (Artif Aziz) wrote. Check out my blog for more information on this:

CronTab schedule parser algorithm

If you think in a higher level (enterprise level), you could consider buying Control-M, one of the most powerful scheduler tools I have ever used, however it is quite expensive.

Cheers!

Roberto.

Upvotes: 1

Andrew
Andrew

Reputation: 1873

Under windows you can use the at utility.

Upvotes: 2

Lee
Lee

Reputation: 18747

You can always use Windows Scheduled Tasks. They can be ugly, but effective.

Upvotes: 3

heavyd
heavyd

Reputation: 17721

You can use the Windows Task Scheduler in the Control Panel. Just set up a task to run your application on the specified day. You can even tell it to run as a certain user if you want.

Upvotes: 1

MicTech
MicTech

Reputation: 45023

You can use Windows Scheduler for planning execute app once a week.

Upvotes: 2

Reed Copsey
Reed Copsey

Reputation: 564413

You could use the Windows Task Scheduler. It was designed with this scenario in mind.

Upvotes: 2

Related Questions