13 unstable releases (6 breaking)

0.6.1 Oct 6, 2025
0.5.3 Jun 23, 2025
0.5.1 Mar 18, 2025
0.3.0 Sep 25, 2024
0.1.0 Feb 22, 2024

#12 in #key-set

Download history 261695/week @ 2026-03-03 1654244/week @ 2026-03-10 1378197/week @ 2026-03-17 1360018/week @ 2026-03-24 1510238/week @ 2026-03-31 1706794/week @ 2026-04-07 1743506/week @ 2026-04-14 1805479/week @ 2026-04-21 1824136/week @ 2026-04-28 2026870/week @ 2026-05-05 2419974/week @ 2026-05-12 2363302/week @ 2026-05-19 2313513/week @ 2026-05-26 1963666/week @ 2026-06-02

9,399,757 downloads per month
Used in 994 crates (65 directly)

MIT/Apache

105KB
2.5K SLoC

Windows registry

The windows-registry crate provides simple, safe, and efficient access to the Windows registry.

Start by adding the following to your Cargo.toml file:

[dependencies.windows-registry]
version = "0.6"

Read and write registry keys and values as needed:

use windows_registry::*;

fn main() -> Result<()> {
    let key = CURRENT_USER.create("software\\windows-rs")?;

    key.set_u32("number", 123)?;
    key.set_string("name", "Rust")?;

    println!("{}", key.get_u32("number")?);
    println!("{}", key.get_string("name")?);

    Ok(())
}

Use the options() method for even more control:

use windows_registry::*;

fn main() -> Result<()> {
    let tx = Transaction::new()?;

    let key = CURRENT_USER
        .options()
        .read()
        .write()
        .create()
        .transaction(&tx)
        .open("software\\windows-rs")?;

    key.set_u32("name", 123)?;

    tx.commit()?;

    Ok(())
}

Dependencies