9 releases

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

#37 in Windows APIs

Download history 123/week @ 2023-02-13 138/week @ 2023-02-20 70/week @ 2023-02-27 80/week @ 2023-03-06 135/week @ 2023-03-13 71/week @ 2023-03-20 132/week @ 2023-03-27 141/week @ 2023-04-03 210/week @ 2023-04-10 82/week @ 2023-04-17 101/week @ 2023-04-24 134/week @ 2023-05-01 106/week @ 2023-05-08 56/week @ 2023-05-15 54/week @ 2023-05-22 81/week @ 2023-05-29

310 downloads per month
Used in nvidia-gamestream-presets-tool

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

~160–260KB