Skip to content

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

License

Notifications You must be signed in to change notification settings

felixrieseberg/windows-shortcuts-ps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

Resources

License

Stars

Watchers

Forks

Packages

No packages published