Run batch file from Electron main thread
问题 I'm attempting to run a simple batch file from my electron application. Here is my code: globalShortcut.register('Control+B', () => { log.info('Batch File Triggered: ' + app.getAppPath() + '\\local\\print.bat') require('child_process').exec(app.getAppPath() + '\\local\\print.bat', function (err, stdout, stderr) { if (err) { // Ooops. // console.log(stderr); return console.log(err); } // Done. console.log(stdout); }); }) The batch file should be triggered when Control+B is pressed by the user,