You do this almost like you would on Linux, just prefix your command with
what will spawn it nicely =). Sounds like you want something like this:
child_process.spawn('cmd.exe', ['/low', '/s', '/c', 'java -jar my.jar'],
...).
If you're already seeing "cmd.exe" in task manager and that's not what
you're launching, it sounds like you're using child_process.exec (which
launches a shell to interpret your command) instead of .spawn or .execFile
(which just launch your command, but require/allow you to specify
individual arguments in an array, instead of playing with appropriate
quoting and escaping which might get ugly in this case depending on what
you're launching =).
Hope this helps!
Jimb Esser
On Friday, June 19, 2015 at 6:34:16 AM UTC-7, Federico Pici wrote:
>
> Hi everybody,
> i am trying to execute a java application from my node app.
> I am able to execute such application with child_process.exe. In task
> manager i can see it executes a cmd.exe /s /c <my executable>
>
> Now i need to start such process with *low *priority (so i should
> basically add a */low* switch to cmd.exe).
> How can i achieve such result? I have tryed shell option with no luck.
> Under Linux/OSX it is easy because i must only add nice -v 19 before my
> java -jar command....
>
>
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/2b70dacd-cf76-4bb7-a31a-94c5781baf9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.