windows-shortcuts-ps

1.0.1 • Public • Published

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('./my-shortcut.lnk').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.

Package Sidebar

Install

npm i windows-shortcuts-ps

Weekly Downloads

6

Version

1.0.1

License

MIT

Last publish

Collaborators

  • felixrieseberg