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)