Skip to content

About

ownership-oriented Windows process creation

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

windows-spawn

CI

Windows process creation with the API of std::process::Command, plus what CreateProcessW offers beyond it: process trees that end with their owner, Jobs, pseudoconsoles, handle handoff, suspended inspection, alternate parents, priority classes, and mitigation policies.

Use std::process::Command for portable child processes. Use this crate when a Windows program needs one of these, or a spawn that passes the child no stray handle and releases everything when a step fails.

Requires Windows 10 version 1809 or later and Rust 1.84 or later. Non-Windows targets expose no API.

Not affiliated with Microsoft or windows-rs; windows- names the target platform.

Installation

cargo add windows-spawn

Example

Run a tool, collect its output, and end every process it started:

use windows_spawn::Command;

let output = Command::new("cmd.exe")
    .args(["/D", "/C", "echo hello"])
    .own_process_tree()
    .output()?;
assert!(output.status.success());
# Ok::<(), windows_spawn::SpawnError>(())

The crate documentation leads with one example for each common task: ending a process tree, running a console tool from a GUI program, running a batch script, attaching a pseudoconsole, and more.

Documentation

License

Apache-2.0 OR MIT.

About

ownership-oriented Windows process creation

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages