繁体   English   中英

Node.js执行.lnc文件

[英]Node.js execute .lnc file

通过node.js打开快捷方式(.lnk)时出现问题。 我应该怎么打开它?

 var exec = require('child_process').execFile; var runLibreOffice =function(){ exec('D:\\\\Downloads\\\\bot\\\\botgo.lnk', function(err, data) { console.log(err) console.log(data.toString()); }); } runLibreOffice(); 

也许使用Windows快捷方式,您可以读取并执行.exe到快捷方式中。

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.' }
*/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM