Is it possible to run some C# script under Windows periodically? I mean something like a SQL job etc. I know the solution via SSIS but it's not exactly what I am looking for.
Asked
Active
Viewed 921 times
-4
-
3A [scheduled task](http://en.wikipedia.org/wiki/Windows_Task_Scheduler)? – vcsjones May 21 '13 at 14:49
-
1Why not just Windows Task Scheduler? – Arran May 21 '13 at 14:49
-
If you are not big fan of Windows Scheduler, give a look at Topshelf. http://topshelf-project.com/ – Nipun Ambastha May 21 '13 at 15:01
-
Or you could create a second project, that calls your first project periodically (using a `System.Timers.Timer`) and set up that second project to autostart with Windows, so you don't need to start it manually every time you boot your PC. The choice is yours. – Nolonar May 21 '13 at 15:11
2 Answers
0
Basically, if your task is more than just periodical running of small piece of code, you are going to end up with windows service having BackgroundWorker
thread, running some task on timer.
Here is some links to start with

vittore
- 17,449
- 6
- 44
- 82
-
Thank you vittore for useful links - I will go through it. For my small piece of c# code Win Task Schedule will be fine. P. – Petr May 23 '13 at 06:36
0
I use task scheduler for that: http://windows.microsoft.com/en-sg/windows7/schedule-a-task
Press Windows + R, write "control schedtasks" and press enter to open the task scheduler.
Create a new task:
Set "Triggers" (run periodical) and "Actions" (run your script) in the menu and save.

Emil
- 1,414
- 1
- 12
- 14