Skip to content

Repository files navigation

WindowsJobAPI

NuGet

A small .NET library for grouping processes in a Windows Job Object. Disposing the job terminates every process assigned to it.

Usage

using System.Diagnostics;
using WindowsJobAPI;

using Process process = Process.Start(new ProcessStartInfo
{
    FileName = "cmd.exe",
    UseShellExecute = false,
}) ?? throw new InvalidOperationException("Unable to start the process.");

using JobObject job = new();
if (!job.AddProcess(process))
{
    throw new InvalidOperationException("Unable to add the process to the job.");
}

// Disposing job terminates process and any child processes in the same job.

License

MIT

About

A small .NET library for grouping processes in a Windows Job Object. Disposing the job terminates every process assigned to it.

Resources

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages