I have a nodejs app running on my local windows machine. I need to open an app, let’s say notepad.
Here is the code
exec(`"${execPath}" ${args}`, {
windowsHide: true
}, (error, stdout, stderr) => {
if (error) {
console.log(error);
}
});
if i open a powershell and run the app with
node app.js
it works as expected. But if i start the app with pm2 it doesn’t.
Taking a look at running processes i noticed that the app process gets started but the app GUI doesn’t
I tried creating a bat file and also a powershell file
spawn('cmd.exe', ['/c', batFilePath, execPath, args]);
but i always get the same result.
Dario is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.