win_machine_guid

Crates.iowin_machine_guid
lib.rswin_machine_guid
version0.1.1
created_at2026-01-16 16:17:05.233866+00
updated_at2026-01-16 16:28:57.587359+00
descriptionA simple library to read and reset the Windows MachineGuid registry key.
homepage
repositoryhttps://github.com/dietcokezerosugar/win_machine_guid_lib
max_upload_size
id2048859
size15,373
サンチット (dietcokezerosugar)

documentation

README

📦 Windows Machine GUID Library

Crates.io License Downloads

A lightweight, safe Rust library to programmatically read, write, and reset the Windows MachineGuid registry key.

This is the core engine behind the popular Windows Machine GUID Resetter tool. Now available as a standalone library for your own privacy tools, system administration scripts, or configuration utilities.


🚀 Installation

Add this to your Cargo.toml:

[dependencies]
win_machine_guid = "0.1.0"

View on Crates.io: https://crates.io/crates/win_machine_guid

🛠️ Usage

1. Read the Current GUID

use win_machine_guid;

fn main() {
    match win_machine_guid::get_current_guid() {
        Ok(guid) => println!("Current Machine GUID: {}", guid),
        Err(e) => eprintln!("Error reading GUID: {}", e),
    }
}

2. Reset to a Random GUID

⚠️ Admin Privileges Required: This function will fail if run without Administrator rights.

fn reset_identity() {
    match win_machine_guid::reset_guid() {
        Ok(new_guid) => println!("Success! New GUID is: {}", new_guid),
        Err(e) => eprintln!("Failed: {}", e),
    }
}

3. Set a Custom GUID

fn set_custom() {
    let my_guid = "00000000-0000-0000-0000-000000000000";
    if let Err(e) = win_machine_guid::set_guid(my_guid) {
        eprintln!("Could not set custom GUID: {}", e);
    }
}

🔒 Safety

  • Typed Errors: Uses thiserror to distinguish between Registry errors and Permission errors.
  • Dependency Lite: Only depends on winreg and uuid.
  • Verified: Powering production-ready privacy tools.

🤝 Contributing

Found a bug? Want to add async support? Fork the repo and submit a PR!

📜 License

MIT License.

Commit count: 6

cargo fmt