winlink
v1.0.2
Published
Write Windows .LNK (MS-SHLLINK) files in pure JS
Downloads
14
Maintainers
Readme
Write & Read Windows .LNK files in pure JS
Implemented following the [MS-SHLLINK] Shell Link (.LNK) Binary File Format Documentation.
While the documentation above is a good starting point, it is missing essential information about the LinkTargetIDList-ItemID structure. This information was obtained by:
- Reverse engineering existing files and padding
0
s instead of real values - Finding some guesses in a Java Implementation by Dmitrii Shamrikov
- Finding some guesses in mslink by Mika�l Le Bohec
Feel free to improve this library, but please make sure to read all sources above before.
Installation:
npm install winlink
Usage:
const winlink = require("winlink");
/* create file-link: writeFile( filename, target ) */
winlink.writeFile( "a.lnk", "C:\\temp\\a.txt" )
.then( () => console.log( "file link created" ) )
.catch( console.log.bind( console ) );
/* create directory-link: writeDirectory( filename, target ) */
winlink.writeDirectory( "test.lnk", "C:\\temp" )
.then( () => console.log( "directory link created" ) )
.catch( console.log.bind( console ) );
Motivation for pure JavaScript:
My intention is to write .lnk
-files on samba-mounts under linux without using wine or other helpers.