簡體   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