TaskScheduler 2.10.1

.NET 5.0 .NET Core 2.0 .NET Standard 2.0 .NET Framework 2.0
Install-Package TaskScheduler -Version 2.10.1
dotnet add package TaskScheduler --version 2.10.1
<PackageReference Include="TaskScheduler" Version="2.10.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TaskScheduler --version 2.10.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: TaskScheduler, 2.10.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install TaskScheduler as a Cake Addin
#addin nuget:?package=TaskScheduler&version=2.10.1

// Install TaskScheduler as a Cake Tool
#tool nuget:?package=TaskScheduler&version=2.10.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

About

The original and most popular .NET wrapper for the Windows Task Scheduler. It provides functionally complete classes that cover all development aspects related to system tasks.

More information can be found on the project page on GitHub.

Support

Below are links to sites that provide in-depth examples, documentation and discussions. Please go here first with your questions as the community has been active for over a decade.

  • Wiki - Sample code, library how-to, troubleshooting, etc.
  • API documentation - Class/method/property documentation and examples
  • Full Issues Log - Use the search box to see if your question may already be answered.
  • Discussion Forum - Users helping users, enhancement requests, Q&A (retired Google forum here)
  • Troubleshooting Tool - Tool to help identify and fix configuration and connectivity issues. (ClickOnce installer here)

Key Features

Microsoft introduced version 2.0 (internally version 1.2) with a completely new object model with Windows Vista. The managed assembly closely resembles the new object model but allows the 1.0 (internally version 1.1) COM objects to be manipulated. It will automatically choose the most recent version of the library found on the host system (up through 1.4). Core features include:

  • Separate, functionally identical, libraries for .NET 2.0, 3.5, 4.0, 4.52, 5.0, 6.0, .NET Standard 2.0, .NET Core 2.0, 2.1, 3.0, 3.1.
  • Unlike the base COM libraries, this wrapper accommodates creating and viewing tasks up and down stream.
  • Supports all V2 native properties, even under V1 tasks.
  • Maintain EmailAction and ShowMessageAction using PowerShell scripts for systems after Win8 where these actions have been deprecated.
  • Supports all action types (not just ExecAction) on V1 systems (XP/WS2003) and earlier (if PowerShell is installed).
  • Supports multiple actions on V1 systems (XP/WS2003). Native library only supports a single action.
  • Supports serialization to XML for both 1.0 and 2.0 tasks (base library only supports 2.0)
  • Supports task validation for targeted version.
  • Supports secure task reading and maintenance.
  • Fluent methods for task creation.
  • Cron syntax for trigger creation.

The currently supported localizations include: English, Spanish, Italian, French, Chinese (Simplified), German, Polish and Russian.

Usage

You can perform several actions in a single line of code:

// Run a program every day on the local machine
TaskService.Instance.AddTask("Test", QuickTriggerType.Daily, "myprogram.exe", "-a arg");

// Run a custom COM handler on the last day of every month
TaskService.Instance.AddTask("Test", new MonthlyTrigger { RunOnLastDayOfMonth = true }, 
    new ComHandlerAction(new Guid("{CE7D4428-8A77-4c5d-8A13-5CAB5D1EC734}")));

For many more options, use the library classes to build a complex task. Below is a brief example of how to use the library from C#.

using System;
using Microsoft.Win32.TaskScheduler;

class Program
{
   static void Main()
   {
      // Get the service on the remote machine
      using (TaskService ts = new TaskService(@"\\RemoteServer", "username", "domain", "password"))
      {
         // 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.
         // (Use the username here to ensure remote registration works.)
         ts.RootFolder.RegisterTaskDefinition(@"Test", td, TaskCreation.CreateOrUpdate, "username");
      }
   }
}

For extended examples on how to the use the library, look at the Examples Page.

Product Versions
.NET net5.0 net5.0-windows net5.0-windows7.0 net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net6.0-windows7.0
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net20 net35 net40 net403 net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (14)

Showing the top 5 NuGet packages that depend on TaskScheduler:

Package Downloads
Dynamicweb.Scheduling

API used for running scheduled tasks

TaskSchedulerEditor

Provides localizable UI elements for editing classes in the TaskScheduler library.

UACHelper

UACHelper is a helper class library to detect, manage and use UAC functionalities (Supporting WinXP+)

BIP.RPA.CommonUtilities

A nuget utility shared for robots made by BIP

KinectX

Extensions for Microsoft Kinect v2

GitHub repositories (36)

Showing the top 5 popular GitHub repositories that depend on TaskScheduler:

Repository Stars
netchx/netch
A simple proxy client
BeyondDimension/SteamTools
🛠「Watt Toolkit」是一个开源跨平台的多功能 Steam 工具箱。
win-acme/win-acme
A simple ACME client for Windows (for use with Let's Encrypt et al.)
AutoDarkMode/Windows-Auto-Night-Mode
Automatically switches between the dark and light theme of Windows 10 and Windows 11
Codeusa/Borderless-Gaming
Play your favorite games in a borderless window; no more time consuming alt-tabs.
Version Downloads Last updated
2.10.1 21,447 2/10/2022
2.10.0 3,782 1/24/2022
2.9.3 12,041 12/13/2021
2.9.2 28,053 9/30/2021
2.9.1 187,630 1/28/2021
2.9.0 19,094 12/9/2020
2.8.21 168,376 9/1/2020
2.8.20 30,760 6/20/2020
2.8.19 13,835 6/1/2020
2.8.18 293,795 12/20/2019
2.8.17 23,568 11/9/2019
2.8.16 24,311 10/15/2019
2.8.15 72,549 7/19/2019
2.8.14 3,923 7/17/2019
2.8.13 5,024 7/12/2019
2.8.12 14,016 6/18/2019
2.8.11 25,426 5/6/2019
2.8.10 20,150 4/8/2019
2.8.8 36,946 3/5/2019
2.8.7 97,063 1/2/2019
2.8.6 46,549 10/26/2018
2.8.5 36,767 9/17/2018
2.8.4 25,896 7/18/2018
2.8.3 4,187 7/18/2018
2.8.2 4,632 7/16/2018
2.8.1 59,541 4/14/2018
2.8.0 13,029 3/12/2018
2.7.4 64,462 3/2/2018
2.7.3 9,837 2/9/2018
2.7.2 90,807 11/16/2017
2.7.1 4,743 11/16/2017
2.6.5 8,056 11/7/2017
2.6.4 4,150 11/7/2017
2.6.3 8,391 10/23/2017
2.6.2 13,218 10/6/2017
2.6.1 16,580 9/13/2017
2.6.0 49,327 8/29/2017
2.5.28 56,468 6/27/2017
2.5.27 7,644 6/26/2017
2.5.26 12,040 6/26/2017
2.5.24 9,424 6/26/2017
2.5.23 1,938,124 4/7/2017
2.5.22 67,386 2/5/2017
2.5.21 149,454 7/29/2016
2.5.20 60,957 5/14/2016
2.5.19 22,133 4/27/2016
2.5.18 7,418 4/11/2016
2.5.17 4,391 4/7/2016
2.5.16 19,521 3/15/2016
2.5.15 5,341 3/10/2016
2.5.14 7,452 2/12/2016
2.5.13 11,902 2/7/2016
2.5.12 11,392 1/13/2016
2.5.11 8,086 1/4/2016
2.5.10 3,952 12/30/2015
2.5.9 4,166 12/26/2015
2.5.8 3,994 12/22/2015
2.5.7 4,543 12/16/2015
2.5.6 5,408 12/11/2015
2.5.5 4,585 12/7/2015
2.5.4 18,431 11/17/2015
2.5.3 7,282 11/11/2015
2.5.2 3,985 11/10/2015
2.5.1 3,929 11/9/2015
2.5.0 4,610 11/2/2015
2.4.2 41,157 9/17/2015
2.4.0 12,329 8/14/2015
2.3.4 10,075 6/26/2015
2.3.3 3,990 6/24/2015
2.3.2 24,344 4/24/2015
2.3.1 5,890 3/23/2015
2.3.0 26,531 12/18/2014
2.2.2 13,853 9/25/2014
2.2.1 4,682 9/10/2014
2.2.0 11,593 5/4/2014
2.1.1 5,390 4/17/2014
2.1.0 5,112 4/9/2014
2.0.3 10,055 1/7/2014
2.0.0 10,646 9/17/2013
1.9.4 44,824 3/21/2013
1.9.3 4,746 2/11/2013
1.9.2 5,449 11/29/2012
1.8.3 5,001 7/3/2012
1.8.2 4,434 5/18/2012
1.8.1 4,614 3/14/2012
1.8.0 4,395 1/27/2012
1.7.1 4,219 12/27/2011
1.7.0 5,361 9/13/2011
1.6.3 4,352 7/21/2011
1.6.2 4,198 6/18/2011
1.6.1 4,257 5/4/2011
1.6.0 4,513 4/5/2011