TaskScheduler 2.10.1
dotnet add package TaskScheduler --version 2.10.1
NuGet\Install-Package TaskScheduler -Version 2.10.1
<PackageReference Include="TaskScheduler" Version="2.10.1" />
paket add TaskScheduler --version 2.10.1
#r "nuget: TaskScheduler, 2.10.1"
// 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
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 net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows |
.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 net481 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen40 tizen60 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
-
.NETCoreApp 2.0
- Microsoft.Win32.Registry (>= 5.0.0)
- System.Diagnostics.EventLog (>= 5.0.0)
- System.Security.AccessControl (>= 5.0.0)
-
.NETCoreApp 2.1
- Microsoft.Win32.Registry (>= 5.0.0)
- System.Diagnostics.EventLog (>= 5.0.0)
- System.Security.AccessControl (>= 5.0.0)
-
.NETCoreApp 3.0
- Microsoft.Win32.Registry (>= 5.0.0)
- System.Diagnostics.EventLog (>= 5.0.0)
- System.Security.AccessControl (>= 5.0.0)
-
.NETCoreApp 3.1
- Microsoft.Win32.Registry (>= 5.0.0)
- System.Diagnostics.EventLog (>= 5.0.0)
- System.Security.AccessControl (>= 5.0.0)
-
.NETFramework 2.0
- No dependencies.
-
.NETFramework 3.5
- No dependencies.
-
.NETFramework 4.0
- No dependencies.
-
.NETFramework 4.5.2
- No dependencies.
-
.NETStandard 2.0
- Microsoft.Win32.Registry (>= 5.0.0)
- System.Diagnostics.EventLog (>= 5.0.0)
- System.Reflection (>= 4.3.0)
- System.Runtime.Serialization.Formatters (>= 4.3.0)
- System.Security.AccessControl (>= 5.0.0)
- System.Security.Permissions (>= 5.0.0)
- System.Security.Principal.Windows (>= 5.0.0)
- System.Xml.XmlSerializer (>= 4.3.0)
-
net5.0-windows7.0
- Microsoft.Win32.Registry (>= 5.0.0)
- System.Diagnostics.EventLog (>= 5.0.0)
- System.Security.AccessControl (>= 5.0.0)
-
net6.0-windows7.0
- Microsoft.Win32.Registry (>= 5.0.0)
- System.Diagnostics.EventLog (>= 5.0.0)
- System.Security.AccessControl (>= 5.0.0)
NuGet packages (14)
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+) |
|
BIP.RPA.CommonUtilities
A nuget utility shared for robots made by BIP |
|
ZeroInstall.Commands
Command-line interface for Zero Install (both an actual CLI and a library for building other clients) |
GitHub repositories (51)
Showing the top 5 popular GitHub repositories that depend on TaskScheduler:
Repository | Stars |
---|---|
2dust/v2rayN
A V2Ray client for Windows, support Xray core and v2fly core
|
|
netchx/netch
A simple proxy client
|
|
BeyondDimension/SteamTools
🛠「Watt Toolkit」是一个开源跨平台的多功能 Steam 工具箱。
|
|
nilaoda/N_m3u8DL-CLI
[.NET] m3u8 downloader 开源的命令行m3u8/HLS/dash下载器,支持普通AES-128-CBC解密,多线程,自定义请求头等. 支持简体中文,繁体中文和英文. English Supported.
|
|
AutoDarkMode/Windows-Auto-Night-Mode
Automatically switches between the dark and light theme of Windows 10 and Windows 11
|
Version | Downloads | Last updated |
---|---|---|
2.10.1 | 152,293 | 2/10/2022 |
2.10.0 | 8,426 | 1/24/2022 |
2.9.3 | 23,434 | 12/13/2021 |
2.9.2 | 50,633 | 9/30/2021 |
2.9.1 | 244,504 | 1/28/2021 |
2.9.0 | 24,967 | 12/9/2020 |
2.8.21 | 225,544 | 9/1/2020 |
2.8.20 | 39,728 | 6/20/2020 |
2.8.19 | 18,768 | 6/1/2020 |
2.8.18 | 480,749 | 12/20/2019 |
2.8.17 | 33,729 | 11/9/2019 |
2.8.16 | 28,523 | 10/15/2019 |
2.8.15 | 92,862 | 7/19/2019 |
2.8.14 | 4,170 | 7/17/2019 |
2.8.13 | 5,476 | 7/12/2019 |
2.8.12 | 14,692 | 6/18/2019 |
2.8.11 | 26,880 | 5/6/2019 |
2.8.10 | 22,106 | 4/8/2019 |
2.8.8 | 46,023 | 3/5/2019 |
2.8.7 | 140,219 | 1/2/2019 |
2.8.6 | 56,596 | 10/26/2018 |
2.8.5 | 43,550 | 9/17/2018 |
2.8.4 | 28,297 | 7/18/2018 |
2.8.3 | 4,455 | 7/18/2018 |
2.8.2 | 4,879 | 7/16/2018 |
2.8.1 | 62,757 | 4/14/2018 |
2.8.0 | 14,758 | 3/12/2018 |
2.7.4 | 66,923 | 3/2/2018 |
2.7.3 | 10,114 | 2/9/2018 |
2.7.2 | 114,656 | 11/16/2017 |
2.7.1 | 5,003 | 11/16/2017 |
2.6.5 | 8,567 | 11/7/2017 |
2.6.4 | 5,381 | 11/7/2017 |
2.6.3 | 8,948 | 10/23/2017 |
2.6.2 | 13,490 | 10/6/2017 |
2.6.1 | 18,088 | 9/13/2017 |
2.6.0 | 75,662 | 8/29/2017 |
2.5.28 | 60,288 | 6/27/2017 |
2.5.27 | 8,190 | 6/26/2017 |
2.5.26 | 12,652 | 6/26/2017 |
2.5.24 | 9,831 | 6/26/2017 |
2.5.23 | 1,961,873 | 4/7/2017 |
2.5.22 | 74,548 | 2/5/2017 |
2.5.21 | 164,882 | 7/29/2016 |
2.5.20 | 69,473 | 5/14/2016 |
2.5.19 | 27,897 | 4/27/2016 |
2.5.18 | 7,720 | 4/11/2016 |
2.5.17 | 4,681 | 4/7/2016 |
2.5.16 | 20,385 | 3/15/2016 |
2.5.15 | 5,715 | 3/10/2016 |
2.5.14 | 7,768 | 2/12/2016 |
2.5.13 | 12,242 | 2/7/2016 |
2.5.12 | 12,121 | 1/13/2016 |
2.5.11 | 8,923 | 1/4/2016 |
2.5.10 | 4,190 | 12/30/2015 |
2.5.9 | 4,449 | 12/26/2015 |
2.5.8 | 4,244 | 12/22/2015 |
2.5.7 | 4,811 | 12/16/2015 |
2.5.6 | 5,699 | 12/11/2015 |
2.5.5 | 4,780 | 12/7/2015 |
2.5.4 | 18,811 | 11/17/2015 |
2.5.3 | 7,539 | 11/11/2015 |
2.5.2 | 4,221 | 11/10/2015 |
2.5.1 | 4,186 | 11/9/2015 |
2.5.0 | 4,861 | 11/2/2015 |
2.4.2 | 43,486 | 9/17/2015 |
2.4.0 | 12,954 | 8/14/2015 |
2.3.4 | 10,415 | 6/26/2015 |
2.3.3 | 4,246 | 6/24/2015 |
2.3.2 | 31,478 | 4/24/2015 |
2.3.1 | 6,835 | 3/23/2015 |
2.3.0 | 30,134 | 12/18/2014 |
2.2.2 | 14,622 | 9/25/2014 |
2.2.1 | 4,964 | 9/10/2014 |
2.2.0 | 12,018 | 5/4/2014 |
2.1.1 | 5,744 | 4/17/2014 |
2.1.0 | 5,379 | 4/9/2014 |
2.0.3 | 10,466 | 1/7/2014 |
2.0.0 | 11,124 | 9/17/2013 |
1.9.4 | 49,638 | 3/21/2013 |
1.9.3 | 4,999 | 2/11/2013 |
1.9.2 | 5,765 | 11/29/2012 |
1.8.3 | 5,281 | 7/3/2012 |
1.8.2 | 4,702 | 5/18/2012 |
1.8.1 | 4,923 | 3/14/2012 |
1.8.0 | 4,658 | 1/27/2012 |
1.7.1 | 4,476 | 12/27/2011 |
1.7.0 | 5,614 | 9/13/2011 |
1.6.3 | 4,639 | 7/21/2011 |
1.6.2 | 4,468 | 6/18/2011 |
1.6.1 | 4,517 | 5/4/2011 |
1.6.0 | 4,858 | 4/5/2011 |