通过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快捷方式,您可以在快捷方式中读取并执行de.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.' }
*/