-2

I'm quite new with javascript. What i'm trying to do here is to get the applications open in task manager using javascript. If the application already open then the script will not open again the application. So the purpose is to check whether the application already open or not. Is it possible? Thanks.

  • Possible duplicate of [how to start up a desktop application in client side](https://stackoverflow.com/questions/6265717/how-to-start-up-a-desktop-application-in-client-side) – buræquete Nov 01 '18 at 10:50

1 Answers1

0

I think it is possible to do this with node js child_process. https://nodejs.org/api/child_process.html

const sys = require('sys')
const exec = require('child_process').exec  

exec('cmd', (error, stdout, stderr) => {
  sys.print('stdout: ' + stdout);
  sys.print('stderr: ' + stderr);

  if (error !== null) {
    console.log('Error:' + error)
  } else {
    console.log('Success!')
  }
}

you can execute OS commands to do what you want. check this as well: https://dzone.com/articles/execute-unix-command-nodejs

Note: form the browser it is not possible to do this with JavaScript. (security reasons)

V. Sambor
  • 12,361
  • 6
  • 46
  • 65