lnks

Crates.iolnks
lib.rslnks
version0.2.0
created_at2025-12-20 03:19:16.751227+00
updated_at2025-12-29 20:26:55.220978+00
descriptionA library for reading and writing windows shortcuts (.lnk).
homepage
repositoryhttps://github.com/OpenByteDev/lnks
max_upload_size
id1995952
size67,863
OpenByte (OpenByteDev)

documentation

https://docs.rs/lnks

README

lnks

CI crates.io Documentation dependency status MIT

lnks provides a high-level API for reading and writing Windows .lnk (Shell Link) files. It wraps the COM-based Shell APIs IShellLinkW and IPersistFile, including support for reading and toggling the undocumented "Run as administrator" flag.

Examples

Load an existing shortcut

let path = Path::new(r"C:\Users\Public\Desktop\Notepad.lnk");
let shortcut = lnks::Shortcut::load(path).unwrap();

Create a new shortcut

let mut shortcut = lnks::Shortcut::new(r"C:\Windows\System32\notepad.exe");
shortcut.arguments = Some(r"C:\Windows\win.ini".to_string());
let out = Path::new(r"C:\Users\Public\Desktop\Notepad.lnk");
shortcut.save(out).unwrap();

License

Licensed under the MIT license (LICENSE or http://opensource.org/licenses/MIT)

Commit count: 0

cargo fmt