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

#103 in Windows APIs

Download history 1028559/week @ 2025-09-25 1019279/week @ 2025-10-02 944276/week @ 2025-10-09 972947/week @ 2025-10-16 974566/week @ 2025-10-23 891713/week @ 2025-10-30 873299/week @ 2025-11-06 917483/week @ 2025-11-13 910824/week @ 2025-11-20 700941/week @ 2025-11-27 947475/week @ 2025-12-04 960068/week @ 2025-12-11 711093/week @ 2025-12-18 383867/week @ 2025-12-25 679427/week @ 2026-01-01 1041816/week @ 2026-01-08

3,001,480 downloads per month
Used in 407 crates (48 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