在 Node 上访问 Windows 快捷方式 (.lnk) 数据 [英] Access Windows shortcuts (.lnk) data on Node

查看:44
本文介绍了在 Node 上访问 Windows 快捷方式 (.lnk) 数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以解析 Node 中 .lnk 文件中的快捷方式数据(例如,主要是它指向的路径)?

Is there any way I can parse shortcut data from .lnk files in Node (for instance, and mainly, the path it's pointing at)?

推荐答案

可以使用 npm 包 windows-shortcuts

You can use the npm package windows-shortcuts

https://www.npmjs.com/package/windows-shortcuts

示例:

ws.query("C:/ProgramData/Microsoft/Windows/Start Menu/Windows Update.lnk", 
console.log);

/* From console:
null { expanded:
   { args: 'startmenu',
     workingDir: 'C:\\Windows\\system32',
     icon: 'C:\\Windows\\system32\\wucltux.dll' },
  target: '%windir%\\system32\\wuapp.exe',
  args: 'startmenu',
  workingDir: '%windir%\\system32',
  runStyle: 1,
  icon: '%windir%\\system32\\wucltux.dll',
  iconIndex: '0',
  hotkey: 0,
  desc: 'Delivers software updates and drivers, and provides automatic updating options.' }
*/

这篇关于在 Node 上访问 Windows 快捷方式 (.lnk) 数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆