#link #shortcut #write #parser #shell #windows #os

lnk

A Rust library to parse and write Windows shortcut files (.lnk)

7 releases (4 breaking)

0.5.1 Jan 11, 2023
0.5.0 Jan 11, 2023
0.4.1 May 16, 2022
0.3.0 Nov 9, 2020
0.1.0 Oct 29, 2019

#217 in Date and time

Download history 5/week @ 2023-12-11 11/week @ 2023-12-18 13/week @ 2023-12-25 7/week @ 2024-01-01 28/week @ 2024-01-08 30/week @ 2024-01-15 12/week @ 2024-01-22 25/week @ 2024-01-29 87/week @ 2024-02-05 56/week @ 2024-02-12 61/week @ 2024-02-19 48/week @ 2024-02-26 48/week @ 2024-03-04 45/week @ 2024-03-11 85/week @ 2024-03-18 60/week @ 2024-03-25

242 downloads per month
Used in 2 crates

MIT license

99KB
1.5K SLoC

Shell Link parser and writer for Rust

Works on any OS - although only really useful in Windows, this library can parse and write .lnk files, a shell link, that can be understood by Windows.

To get started, see the docs.rs documentation.


lib.rs:

Shell Link parser and writer for Rust.

Works on any OS - although only really useful in Windows, this library can parse and write .lnk files, a shell link, that can be understood by Windows.

To get started, see the ShellLink struct.

The full specification of these files can be found at Microsoft's Website.

Read Example

A simple example appears as follows:

use lnk::ShellLink;
// ...
let shortcut = lnk::ShellLink::open("tests/test.lnk").unwrap();
println!("{:#?}", shortcut);

Write Example

A simple example appears as follows:

use lnk::ShellLink;
// ...
ShellLink::new_simple(std::path::Path::new(r"C:\Windows\System32\notepad.exe"));

IMPORTANT!: Writing capability is currently in a very early stage and probably won't work!

Dependencies

~3MB
~58K SLoC