9 releases

0.1.8 May 27, 2022
0.1.7 Oct 19, 2021
0.1.6 Aug 10, 2021

#175 in Windows APIs

Download history 316/week @ 2025-10-23 326/week @ 2025-10-30 493/week @ 2025-11-06 283/week @ 2025-11-13 474/week @ 2025-11-20 419/week @ 2025-11-27 394/week @ 2025-12-04 306/week @ 2025-12-11 343/week @ 2025-12-18 284/week @ 2025-12-25 389/week @ 2026-01-01 318/week @ 2026-01-08 341/week @ 2026-01-15 416/week @ 2026-01-22 445/week @ 2026-01-29 328/week @ 2026-02-05

1,584 downloads per month
Used in 4 crates

MIT license

55KB
937 lines

mslnk

Rust implementation to create Windows shortcut (ms shell .lnk),theoretically support WIndows 7/8/10/11. Tested on Windows 10,11.

Usage

Add this to your Cargo.toml:

[dependencies]
mslnk = "0.1.8"

examole to create lnk

use mslnk::ShellLink;

let target = r"C:\Users\Admin\Desktop\qq aa\qiuqiu.exe";
let lnk = r"C:\Users\Admin\Desktop\qq.lnk";
let sl = ShellLink::new(target).unwrap();
sl.create_lnk(lnk).unwrap();

Error handling

use mslnk::{ShellLink,MSLinkError};

fn main()->Result<(),ApplicationError> {
    let target = r"C:\Users\Admin\Desktop\qq aa\qiuqiu.exe";
    let lnk = r"C:\Users\Admin\Desktop\qq.lnk";
    let sl = ShellLink::new(target)?;
    sl.create_lnk(lnk)?;
}

entirely written in rust,no external command,support unicode string ,such as Chinese characters. Most of code are from lnk-rs for parsing and writing lnk file.

reference

Dependencies

~245–340KB