Skip to content

Instantly share code, notes, and snippets.

@TomerCohen95
Created September 3, 2023 08:01
Show Gist options
  • Select an option

  • Save TomerCohen95/63c0860c320b14f1472cc4c5c46ce47c to your computer and use it in GitHub Desktop.

Select an option

Save TomerCohen95/63c0860c320b14f1472cc4c5c46ce47c to your computer and use it in GitHub Desktop.
fn get_registry_value(key_path: &str) -> Result<String, io::Error> {
let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
let key = hklm.open_subkey(key_path)?;
let value: String = key.get_value("my_key")?;
Ok(value)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment