How can I run a C# application from the Window Task Scheduler?

5,718

Start->Programs->Accessories->Scheduled Tasks

Click the Add Task Button..

Click Next, Select browse...

Find your .exe in your MyDocuments/VisualStudio2008/Porjects/NameOfProject/Debug/bin/yourfile.exe (most likely here)

Follow the wizard to the end.

Share:
5,718

Related videos on Youtube

Gaff
Author by

Gaff

Updated on September 17, 2022

Comments

  • Gaff
    Gaff almost 2 years

    I have a desktop application(C#.NET), where I call a web service.

    I need to invoke the C#.NET application from the Windows Task Scheduler, because I have to plan an execution four times a day.

    How can I do this?

    • gpmcadam
      gpmcadam over 14 years
      Are you asking how to achieve this programmatically, or are you simply asking for guidance on how to add scheduled tasks in Windows?
    • Admin
      Admin over 14 years
      @Bauer: Thanks. No I will use the Windows Task Scheduler. But I don't how to add my desktop application into task scheduler, so that it will run automatically when system is on.Hope you are getting my point.
    • Maxim Zaslavsky
      Maxim Zaslavsky over 14 years
      the above comments are confusing. so, wait, you want to do this manually? Well, then the answers work. If not, the question belongs on SO, but it was already migrated here. On another note, there's a pretty easy-to-use library out there for C# that I've used before to programatically add an entry into the task scheduler.
  • Admin
    Admin over 14 years
    @lexu: Thanks , but i don't know the way to add c# application to windows task scheduler,Please advice me how to terminate the application after execution. I want to run my application everyday (two hours of interval)
  • lexu
    lexu over 14 years
    @purnang.advant: a c# app is an executable (thingy.exe) .. google for windows task scheduler and you will find better advice than I can provide. Look into writing a console app or a windows service for best results regarding the termination issue.