tonhowtf/omniget · error
reg delete falhou
Error message
reg delete falhou: {} What it means
The Windows `reg delete` command (with /ve, /v, and /f as appropriate) exited non-zero; the {} is reg.exe's stderr. Fired from reg_delete, which fix uses to remove registry values — typically the key path is malformed, inaccessible without elevation, or reg.exe refused the forced delete.
Solutions
- Check the exact key path and value name for typos or wrong HKCU/HKLM hive
- Run the application as administrator when deleting from HKEY_LOCAL_MACHINE
- Test the equivalent `reg delete <key> /f` in a terminal to see the raw error
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at src-tauri/omniget-core/src/core/tools/win_registry.rs:112 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/bd27afcbb8da9ef3.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/win_registry.rs:112
}
}
pub async fn reg_delete(key: &str, value: Option<&str>) -> anyhow::Result<()> {
let mut cmd = crate::core::process::command("reg");
cmd.arg("delete").arg(key);
match value {
Some("") => {
cmd.arg("/ve");
}
Some(v) => {
cmd.arg("/v").arg(v);
}
None => {}
}
cmd.arg("/f");
let o = cmd.output().await?;
if !o.status.success() {
return Err(anyhow!(
"reg delete falhou: {}",
String::from_utf8_lossy(&o.stderr).trim()
));
}
Ok(())
}
pub async fn reg_add(key: &str, value: &str, kind: &str, data: &str) -> anyhow::Result<()> {
let mut cmd = crate::core::process::command("reg");
cmd.arg("add").arg(key);
if value.is_empty() {
cmd.arg("/ve");
} else {
cmd.arg("/v").arg(value);
}
cmd.arg("/t").arg(kind).arg("/d").arg(data).arg("/f");
let o = cmd.output().await?;
if !o.status.success() {View on GitHub (pinned to 8600b91f42)