We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
delete_subkey_all_transacted
It would be nice to be able to just run it on a key I know I "own" and have it be tied to a transaction.
The text was updated successfully, but these errors were encountered:
*_transacted methods just call *TransactedW functions from WinAPI. There is RegDeleteKeyTransactedW but there is no RegDeleteTreeTransactedW.
*_transacted
*TransactedW
RegDeleteKeyTransactedW
RegDeleteTreeTransactedW
But you can open transacted key and then delete everything in it with delete_subkey_all:
delete_subkey_all
use std::io; use winreg::enums::*; use winreg::transaction::Transaction; use winreg::RegKey; fn main() -> io::Result<()> { let t = Transaction::new()?; let hkcu = RegKey::predef(HKEY_CURRENT_USER); // ========================================== let key = hkcu.open_subkey_transacted_with_flags("PATH\\TO\\YOUR\\KEY", &t, KEY_ALL_ACCESS)?; key.delete_subkey_all("")?; // ========================================== println!("Delete everything in the key? [y/N]:"); let mut input = String::new(); io::stdin().read_line(&mut input)?; input = input.trim_end().to_owned(); if input == "y" || input == "Y" { t.commit()?; println!("Transaction committed."); } else { t.rollback()?; println!("Transaction wasn't committed, it will be rolled back."); } Ok(()) }
Sorry, something went wrong.
No branches or pull requests
It would be nice to be able to just run it on a key I know I "own" and have it be tied to a transaction.
The text was updated successfully, but these errors were encountered: