Registry / utility / winreg

winreg

JSON →
library0.56.0rscratesunverified

Rust bindings to the MS Windows Registry API for reading and writing registry keys and values.

# Cargo.toml [dependencies] winreg = "0.56.0"
INSTALL
IMPORT
SIG · WINREG
W
winreg
utilityrustv0.56.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RegKey
✓ use winreg::RegKey;

Opens a registry key and reads a value.

use winreg::RegKey; use winreg::enums::*; fn main() { let hklm = RegKey::predef(HKEY_LOCAL_MACHINE); let subkey = hklm.open_subkey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion").unwrap(); let val: String = subkey.get_value("ProgramFilesDir").unwrap(); println!("{}", val); }
Debug
Known issues
gotchaRegistry operations may fail with insufficient permissions; handle errors appropriately.
fix
Use `?` or match on `Result` to handle access denied errors.
affects: >=0.1.0
Upgrade
Version history
0.56.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
winreg — cargo add winreg · libregistry