| Crates.io | lnks |
| lib.rs | lnks |
| version | 0.2.0 |
| created_at | 2025-12-20 03:19:16.751227+00 |
| updated_at | 2025-12-29 20:26:55.220978+00 |
| description | A library for reading and writing windows shortcuts (.lnk). |
| homepage | |
| repository | https://github.com/OpenByteDev/lnks |
| max_upload_size | |
| id | 1995952 |
| size | 67,863 |
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.
let path = Path::new(r"C:\Users\Public\Desktop\Notepad.lnk");
let shortcut = lnks::Shortcut::load(path).unwrap();
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();
Licensed under the MIT license (LICENSE or http://opensource.org/licenses/MIT)