Hi all, im trying to add, edit and remove some registry windows keys with rust but my code doesnt work and in console i dont see nothing error, but in windows registry i dont find the values.
for example my function is like that
use std::process::Command;
fn add_remove_key .... {
if enable {
Command::new("reg")
.args(&[
"add",
r"HKEY_LOCAL_MACHINE\<path>",
"/v",
"<name_key>",
"/t",
"REG_DWORD",
"/d",
"1",
"/f",
])
.spawn()
.map_err(|_| "Failed to......".to_string())?;
} else {
Command::new("reg")
.args(&[
"delete",
r"HKEY_LOCAL_MACHINE\<path>",
"/v",
"<name_key>",
"/f",
])
.spawn()
.map_err(|_| "Failed to....".to_string())?;
}
Ok(())
}