autorun 0.1.0

A simple tool to manage autorun entries on Windows
docs.rs failed to build autorun-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

autorun

A simple tool to manage Windows startup (autorun) entries via the registry Run key.

Manipulates the standard Windows autorun locations:

  • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run

Installation

cargo install autorun

CLI Usage

# List current-user entries (default)
autorun list

# List all entries (HKCU + HKLM)
autorun list -a

# List local-machine entries only
autorun list -s

# Add an entry
autorun add MyApp "C:\my_app\app.exe"

# Add an entry to local machine (requires admin)
autorun add -s MyService "C:\tools\svc.exe"

# Check if an entry exists
autorun check MyApp

# Remove an entry
autorun remove MyApp

# Remove from local machine
autorun remove -s MyService

Library API

use autorun::{self, StartupScope};

// List entries
let entries = autorun::list(StartupScope::CurrentUser).unwrap();
for e in &entries {
    println!("[{}] {} => {}", e.scope, e.name, e.command);
}

// Add / check / remove
autorun::add("MyTool", r"C:\tools\mytool.exe", StartupScope::CurrentUser).unwrap();
assert!(autorun::exists("MyTool", StartupScope::CurrentUser).unwrap());
autorun::remove("MyTool", StartupScope::CurrentUser).unwrap();

// List all scopes (HKLM silently skipped without admin)
let all = autorun::list_all().unwrap();