Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6558979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:15:58+00:00 2026-05-25T13:15:58+00:00

I am working on a C# WPF project. I need to allow the user

  • 0

I am working on a C# WPF project. I need to allow the user to create and add a scheduled task to the Windows Task Scheduler.

How could I go about doing this and what using directives and references do I need as I am not finding much when searching the Internet.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:15:59+00:00Added an answer on May 25, 2026 at 1:15 pm

    You can use Task Scheduler Managed Wrapper:

    using System;
    using Microsoft.Win32.TaskScheduler;
    
    class Program
    {
       static void Main(string[] args)
       {
          // Get the service on the local machine
          using (TaskService ts = new TaskService())
          {
             // Create a new task definition and assign properties
             TaskDefinition td = ts.NewTask();
             td.RegistrationInfo.Description = "Does something";
    
             // Create a trigger that will fire the task at this time every other day
             td.Triggers.Add(new DailyTrigger { DaysInterval = 2 });
    
             // Create an action that will launch Notepad whenever the trigger fires
             td.Actions.Add(new ExecAction("notepad.exe", "c:\\test.log", null));
    
             // Register the task in the root folder
             ts.RootFolder.RegisterTaskDefinition(@"Test", td);
    
             // Remove the task we just created
             ts.RootFolder.DeleteTask("Test");
          }
       }
    }
    

    Alternatively you can use native API or go for Quartz.NET. See this for details.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on a C# 4.0 WPF project and need to figure
Im working on a middle size project, using WPF. Need DataGrid, suitable for the
I'm about to begin working on a Accessibility project for Windows (targeting XP through
I need to display some media in a WPF project. The media could be
I'm working on a multi-lingual WPF project that will be localized into many different
I'm working on the UI side of a WPF project. My favourite reference while
I would like to use an MVVM in a WPF project I'm working on,
I have a project I'm working on that requires our WPF application read SMS
So i am working on a wpf browser project in c# but on of
I have a WPF C# project that I am working on and I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.