0

I am using below Javascript code to launch external process from openfin on Windows,

fin.System.launchExternalProcess({
      path: myApp.bat,
      listener: function (result) { console.log('Launching process: ', result.exitCode); }
    })
    .then(payload => { console.log('process launched') })
    .then(() => { console.log('process is up') })
    .catch(err => console.log(err));

where myApp.bat is like:

@REM env setup and start java
java ...

The process is launched and runs successfully. But there is a visible cmd.exe window, which I'd like to be hidden, or at the very least minimized.

I can modify my batch file to use use javaw.exe or start to get rid of the cmd console,

@REM env setup and start java
javaw 
@REM or
start /min java
exit

but java.exe/javaw.exe will run in a background process and disconnects from openfin, and I won't be able to stop the process from openfin anymore.

Please help with a solution to run the batch file without a visible cmd.exe window, but where openfin can still control, (terminate), the process later.

2
  • What are the @env and @or commands, in your batch files. There should never be a need for just exit to be a command at the end of your batch files either. I should also say that nobody should be using .bat as a file extension for a script run by cmd.exe. Those should use the .cmd extension.
    – Compo
    Commented Jan 19 at 16:36
  • Thanks compo! "env" and "or" are meant to be comments.
    – Jeffrey
    Commented Jan 21 at 18:25

0

Browse other questions tagged or ask your own question.