TaskScheduler 2.11.0

dotnet add package TaskScheduler --version 2.11.0                
NuGet\Install-Package TaskScheduler -Version 2.11.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TaskScheduler" Version="2.11.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TaskScheduler --version 2.11.0                
#r "nuget: TaskScheduler, 2.11.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. 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.11.0

// Install TaskScheduler as a Cake Tool
#tool nuget:?package=TaskScheduler&version=2.11.0                

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 Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net6.0-windows7.0 is compatible.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net7.0-windows7.0 is compatible.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net8.0-windows7.0 is compatible. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (21)

Showing the top 5 NuGet packages that depend on TaskScheduler:

Package Downloads
Dynamicweb.Admin

Package Description

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+)

ZeroInstall.Commands

Command-line interface for Zero Install (both an actual CLI and a library for building other clients)

BIP.RPA.CommonUtilities

A nuget utility shared for robots made by BIP

GitHub repositories (66)

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

Repository Stars
2dust/v2rayN
A GUI client for Windows and Linux, support Xray core and sing-box-core and others
netchx/netch
A simple proxy client
nilaoda/N_m3u8DL-CLI
[.NET] m3u8 downloader 开源的命令行m3u8/HLS/dash下载器,支持普通AES-128-CBC解密,多线程,自定义请求头等. 支持简体中文,繁体中文和英文. English Supported.
Klocman/Bulk-Crap-Uninstaller
Remove large amounts of unwanted applications quickly.
seerge/g-helper
Lightweight Armoury Crate alternative for Asus laptops and ROG Ally. Control tool for ROG Zephyrus G14, G15, G16, M16, Flow X13, Flow X16, TUF, Strix, Scar and other models
Version Downloads Last updated
2.11.0 313,600 5/1/2024
2.10.1 1,064,025 2/10/2022
2.10.0 20,252 1/24/2022
2.9.3 55,610 12/13/2021
2.9.2 78,868 9/30/2021
2.9.1 383,500 1/28/2021
2.9.0 37,200 12/9/2020
2.8.21 370,595 9/1/2020
2.8.20 74,159 6/20/2020
2.8.19 29,685 6/1/2020
2.8.18 862,425 12/20/2019
2.8.17 63,096 11/9/2019
2.8.16 47,906 10/15/2019
2.8.15 127,786 7/19/2019
2.8.14 5,503 7/17/2019
2.8.13 6,816 7/12/2019
2.8.12 16,920 6/18/2019
2.8.11 46,398 5/6/2019
2.8.10 28,547 4/8/2019
2.8.8 68,976 3/5/2019
2.8.7 250,108 1/2/2019
2.8.6 129,720 10/26/2018
2.8.5 62,798 9/17/2018
2.8.4 34,867 7/18/2018
2.8.3 5,706 7/18/2018
2.8.2 6,109 7/16/2018
2.8.1 71,523 4/14/2018
2.8.0 18,575 3/12/2018
2.7.4 70,035 3/2/2018
2.7.3 11,643 2/9/2018
2.7.2 212,328 11/16/2017
2.7.1 6,298 11/16/2017
2.6.5 9,986 11/7/2017
2.6.4 12,562 11/7/2017
2.6.3 10,568 10/23/2017
2.6.2 14,732 10/6/2017
2.6.1 23,105 9/13/2017
2.6.0 96,499 8/29/2017
2.5.28 73,343 6/27/2017
2.5.27 10,141 6/26/2017
2.5.26 16,780 6/26/2017
2.5.24 11,294 6/26/2017
2.5.23 1,996,215 4/7/2017
2.5.22 89,296 2/5/2017
2.5.21 202,346 7/29/2016
2.5.20 91,199 5/14/2016
2.5.19 35,792 4/27/2016
2.5.18 9,203 4/11/2016
2.5.17 6,034 4/7/2016
2.5.16 23,201 3/15/2016
2.5.15 7,386 3/10/2016
2.5.14 9,262 2/12/2016
2.5.13 14,211 2/7/2016
2.5.12 14,999 1/13/2016
2.5.11 22,002 1/4/2016
2.5.10 5,450 12/30/2015
2.5.9 5,659 12/26/2015
2.5.8 5,459 12/22/2015
2.5.7 5,958 12/16/2015
2.5.6 6,897 12/11/2015
2.5.5 5,916 12/7/2015
2.5.4 20,923 11/17/2015
2.5.3 8,736 11/11/2015
2.5.2 5,443 11/10/2015
2.5.1 5,412 11/9/2015
2.5.0 6,113 11/2/2015
2.4.2 46,535 9/17/2015
2.4.0 18,974 8/14/2015
2.3.4 12,001 6/26/2015
2.3.3 5,429 6/24/2015
2.3.2 52,928 4/24/2015
2.3.1 9,535 3/23/2015
2.3.0 40,323 12/18/2014
2.2.2 16,861 9/25/2014
2.2.1 6,281 9/10/2014
2.2.0 15,705 5/4/2014
2.1.1 7,098 4/17/2014
2.1.0 6,648 4/9/2014
2.0.3 12,650 1/7/2014
2.0.0 12,648 9/17/2013
1.9.4 68,611 3/21/2013
1.9.3 6,228 2/11/2013
1.9.2 6,981 11/29/2012
1.8.3 6,645 7/3/2012
1.8.2 5,919 5/18/2012
1.8.1 6,201 3/14/2012
1.8.0 5,867 1/27/2012
1.7.1 5,710 12/27/2011
1.7.0 6,858 9/13/2011
1.6.3 5,903 7/21/2011
1.6.2 5,691 6/18/2011
1.6.1 5,822 5/4/2011
1.6.0 8,005 4/5/2011