# 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
```sh
cargo install autorun
```
## CLI Usage
```sh
# 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
```rust
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();
```