cbartondock / windows-shortcuts-ps

Node.js: Read Windows shortcuts without native dependencies (Windows 7 and up)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

windows-shortcuts-ps

Easily check the actual path for a Windows shortcut (aka a lnk file).

npm install windows-shortcut-ps
const { getPath } = require('windows-shortcut-ps')

getPath('./my-shortcut.lnk').then((actualPath) => console.log(actualPath))

If you need to get the actual path of multiple lnk files, call getPath with an array as parameter. This module uses Node's exec under the hood, which is pretty slow to fire up. If you have twenty files to check, calling the method with an array will take ~0.5 seconds, while calling the method twenty times will take 14 seconds.

const { getPath } = require('windows-shortcut-ps')

const linkPaths = [ './sc1.lnk', './sc2.lnl' ]

getPath(linkPaths).then((actualPaths) => {
  linkPaths.forEach((shortcutPath, i) => {
    console.log(`The real path for ${shortcutPath} is ${actualpaths[i]})
  })
})

License

MIT, please see LICENSE for details. Copyright (c) 2017 Felix Rieseberg.

About

Node.js: Read Windows shortcuts without native dependencies (Windows 7 and up)

License:MIT License


Languages

Language:JavaScript 100.0%