# TaskScheduler for .NET: Windows task automation and localized editors

> TaskScheduler is a C# wrapper for the Windows Task Scheduler that unifies multiple native versions, adds task creation and XML features, and provides optional WinForms editors. It fits Windows applications that need scheduled tasks but offers little value on non-Windows systems.

**dahall/TaskScheduler** — Provides a .NET wrapper for the Windows Task Scheduler. It aggregates the multiple versions, provides an editor and allows for localization.

- Repository: https://github.com/dahall/TaskScheduler
- Stars: 1,346 · Forks: 201
- Language: C#
- License: MIT
- Published: 2026-10-16 · Updated: 2026-10-16 · Language: en
- Canonical page: https://hysenlabs.com/projects/dahall-taskscheduler

## Why TaskScheduler consolidates Windows scheduled tasks

TaskScheduler addresses a specific problem in Windows applications: the native Task Scheduler interface changed substantially when Windows Vista introduced version 2.0, while older systems continued to expose version 1.0 COM objects. Direct code written against one object model may therefore fail or behave differently on another Windows release. The wrapper presents a managed object model and can manipulate both generations. According to the README, it automatically selects the newest library available on the host, through internal version 1.4.

The intended users are developers building Windows applications, administrative tools, deployment software, or scripts that need to register recurring work, run programs, invoke COM handlers, inspect task history, or create a task-definition UI. The main `TaskScheduler` package provides the programmatic API. The separate `TaskSchedulerEditor` package is for applications that need localized WinForms dialogs and controls.

This is not a general-purpose cross-platform job queue. Its purpose is tied to the Windows Task Scheduler and its native actions, triggers, folders, service connection, and security model. That distinction matters when selecting a scheduling library. If a product must run the same scheduler on Linux or macOS, the repository documentation offers no corresponding platform support.

## Task definition, service selection, and registration flow

The documented programming flow starts with a `TaskService`. Calling `TaskService.Instance` targets the local machine in the short example. For remote access, the README constructs `TaskService` with a UNC server path and explicit username, domain, and password. The service then creates a `TaskDefinition`, which holds registration information, triggers, and actions. Registering that definition with a task folder creates the actual Windows scheduled task.

A trigger determines when the definition runs. The API includes trigger classes such as `DailyTrigger` and `MonthlyTrigger`, and it supports a `QuickTriggerType.Daily` shortcut. Actions define what Windows performs. `ExecAction` can launch an executable, while `ComHandlerAction` can register a COM-based handler. The library advertises support for multiple actions and says that it can expose all action types on version 1 systems through PowerShell-based compatibility work.

The wrapper adds behavior beyond direct access to the base COM libraries. Its feature list includes XML serialization for both 1.0 and 2.0 task definitions, task validation for a selected target version, secure task reading and maintenance, fluent task-creation methods, and Cron syntax for triggers. On systems after Windows 8, the wrapper maintains `EmailAction` and `ShowMessageAction` through PowerShell scripts after those native actions were deprecated. These compatibility paths are useful, but they also mean that a task created through the wrapper may have different implementation details from a task created directly against the native API.

## Installing TaskScheduler and creating the first task

The README provides two installation channels but does not give an exact package-manager command. It directs users to NuGet for `TaskScheduler` and `TaskSchedulerEditor`, with prerelease packages available through the project's AppVeyor NuGet feed. Alternatively, the Releases section contains downloadable `.zip` assemblies. Once a package or assembly is referenced, its classes are available from the `Microsoft.Win32.TaskScheduler` namespace.

For a first local task, add `TaskScheduler` rather than the editor package unless the application needs its controls. The following is the README's compact daily-task example:

```csharp
TaskService.Instance.AddTask("Test", QuickTriggerType.Daily, "myprogram.exe", "-a arg");
```

The call registers a task named `Test`, schedules it daily, and launches `myprogram.exe` with the argument `-a arg`. A successful result depends on the executable path being resolvable and the process having permission to create the task, neither of which the README discusses in detail.

For more control, the wrapper can build a definition from separate objects. This example registers it in the root folder:

```csharp
using System;
using Microsoft.Win32.TaskScheduler;

class Program
{
   static void Main(string[] args)
   {
      using (TaskService ts = new TaskService(@"\\RemoteServer", "username", "domain", "password"))
      {
         TaskDefinition td = ts.NewTask();
         td.RegistrationInfo.Description = "Does something";
         td.Triggers.Add(new DailyTrigger { DaysInterval = 2 });
         td.Actions.Add(new ExecAction("notepad.exe", "c:\test.log", null));
      }
   }
}
```

The cleaned README truncates the example before its final registration call, so no complete registration statement is available to reproduce. The visible portion nevertheless documents the relevant flow: connect to a service, create a definition, attach a trigger and action, and prepare the definition for registration.

## Windows version differences and PowerShell dependencies

The largest technical constraint is the Windows version boundary between the two native Task Scheduler object models. Version 2.0 arrived with Windows Vista, while version 1.0 remained relevant to older systems. The wrapper abstracts that split for many operations, but compatibility is not unlimited. It says that all version 2 native properties are exposed even on version 1 systems, although that does not mean the underlying operating system can perform every action natively.

For old systems such as XP and Windows Server 2003, the README specifically requires PowerShell for broader action support. It also uses PowerShell scripts to retain `EmailAction` and `ShowMessageAction` behavior after Windows 8 deprecated those native actions. PowerShell therefore appears to be an important compatibility dependency for some workflows. The documentation does not state which PowerShell versions are required, so applications targeting old operating systems should verify that requirement in their own supported environment.

The wrapper also offers targeted task validation, which is more useful than assuming every host offers every version 2 feature. It can read custom triggers under Windows 8 and later. Even so, features such as history, event-log access, task folders, service connections, credentials, and COM handlers are all coupled to Windows facilities. TaskScheduler should not be presented as a portable scheduler abstraction merely because its consumer code is managed C#.

## TaskSchedulerEditor controls for desktop applications

The optional `TaskSchedulerEditor` package addresses applications that must let users compose tasks instead of supplying every trigger and action in code. Its editors are described as localized and localizable, and the README lists English, Spanish, Italian, French, Simplified Chinese, German, Polish, and Russian among the supported localizations.

The control set covers most of a task-management workflow. It includes `TaskEditDialog`, `TaskOptionsEditor`, and a task-creation wizard modeled on the Windows Basic editor. Separate dialogs edit actions, triggers, and event settings. Additional components select tasks or folders, view task history and run times, configure the service connection, and request credentials through `CredentialsDialog`. The library also provides simplified access to events in the Windows system log, a `DropDownCheckList` for flag enumerations, and a `FullDateTimePicker` that combines date and time selection.

This package is useful when an application needs its own desktop interface, but it adds a second dependency that managed task code alone does not require. The repository topics include WinForms, and the README describes the controls as GUI editors. A command-line service, ASP.NET application without a Windows desktop, or background agent that only creates definitions programmatically would normally inspect `TaskScheduler` first rather than take `TaskSchedulerEditor`.

The editors mimic Windows interfaces but also add pages for additional properties. That distinction can help a product expose wrapper-specific functionality, while making visual consistency with the operating system less exact. Consumers that need custom branding may need to review `TaskEditor` in the repository before committing to the package.

## MIT licensing, compatibility, and release maintenance

The repository identifies the project as licensed under MIT. That permits use and modification under the license's terms, although distribution, notices, and warranty treatment still need to be checked against the actual `license.md` before shipping a product. This review does not provide legal advice.

The README lists separate assemblies for a wide range of targets: .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, and 3.1. Package availability and runtime support still depend on the specific package version selected by the consuming application. The project is written in C#, but the README says the assembly can be called from any .NET language, including scripting languages such as PowerShell.

The repository is not archived, and its last push was on 2026-06-21. Recent release history includes v2.12.2 on 2025-07-08, v2.12.1 on 2025-03-05, and v2.12.0 on 2025-02-26. These facts show that releases continued after the older targets listed in the README were introduced, but they do not establish that every historical target remains equally suitable. Upgrading requires checking the target frameworks of the selected NuGet package, testing task creation and editing on the oldest supported Windows release, and reviewing changes between the installed and intended versions.

Remote access also deserves direct review. The sample passes a password as a plain constructor argument, while the feature list mentions secure task reading and maintenance. The README does not document a complete credential-storage or rotation design, so a consuming application should not assume that passing credentials to the constructor defines a complete security policy.

## Conclusion

Adopt TaskScheduler when a Windows application must create or edit scheduled tasks across native Task Scheduler versions, especially older Windows systems. Do not choose it for a cross-platform scheduler or if your application needs a documented Linux equivalent. Before adoption, verify compatibility with your oldest supported Windows and .NET version, inspect the effects of credentials stored for remote access, and test the exact task actions and trigger types you need. The repository's last push was on 2026-06-21 and the listed release was v2.12.2 from 2025-07-08.

## FAQ

### What platforms does TaskScheduler support?

TaskScheduler is a managed wrapper for the Windows Task Scheduler and is intended for Windows hosts. The documentation describes compatibility with older and newer Task Scheduler versions, but it does not document Linux or macOS support.

### Which NuGet package should a C# application reference?

Use `TaskScheduler` for the main managed API and `TaskSchedulerEditor` when the application also needs localized WinForms task editors and controls. Both place their classes in the `Microsoft.Win32.TaskScheduler` namespace.

### Can TaskScheduler create tasks on older Windows systems?

The wrapper is designed to manipulate both version 1.0 and version 2.0 task objects, including compatibility support for multiple actions on version 1 systems. Broader action support on XP and Windows Server 2003 depends on PowerShell being installed.

## Sources

- [dahall/TaskScheduler on GitHub](https://github.com/dahall/TaskScheduler)
- [Issues](https://github.com/dahall/TaskScheduler/issues)
- [License: MIT](https://github.com/dahall/TaskScheduler/blob/master/LICENSE)
- [README](https://github.com/dahall/TaskScheduler/blob/master/README.md)
- [Releases](https://github.com/dahall/TaskScheduler/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/dahall-taskscheduler
