Skip to content

OpenByteDev/lnks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

A library for reading and writing windows shortcuts (.lnk).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages