How to create new Scheduled Task Programmatically? RRS feed

  • Question

  • I am interested in creating a new scheduled task for Vista / Windows 7 and I am intersted in doing in programmatically for my program. For windows XP I used:

    System.Diagnostics.Process.Start("schtasks", @"/create /tn TestTast /tr C:\test.exe /sc daily /st 18:55:00");

    How would I go about doing this for Vista / Windows 7 programmatically, if I also wanted to 'select' the "Run task as soon as possible after a scheduled start is missed" option?

    Thank you

    • Edited by Malte Ahrens Sunday, July 12, 2009 1:28 PM Fixed Formating Issue
    Sunday, July 12, 2009 1:27 PM


  • Thank you for your reply, but I found help elsewhere. Also, most of the replies in the threads were talking about 'Task Scheduler 1.0' from XP not 'Task Scheduler 2.0' from Vista / Windows 7 and were therefore little use.

    I have found what I wanted from this site: http://taskscheduler.codeplex.com/. It gives you a .NET wrapper and lets you use the wrapper for both XP & Vista / Windows 7, while still being able to use 'Task Scheduler 2.0' features.

    • Marked as answer by Malte Ahrens Monday, July 13, 2009 12:44 AM
    Monday, July 13, 2009 12:44 AM

All replies