# Calling processing-java from node on Windows 10

**URL:** <https://discourse.processing.org/t/calling-processing-java-from-node-on-windows-10/24819>\
**Category:** Processing\
**Created:** [October 22, 2020, 12:40pm UTC](https://discourse.processing.org/t/calling-processing-java-from-node-on-windows-10/24819 "2020-10-22T12:40:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cheister](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@cheister](https://discourse.processing.org/u/cheister)\
**Post date:** [October 22, 2020, 12:40pm UTC](https://discourse.processing.org/t/calling-processing-java-from-node-on-windows-10/24819/1 "2020-10-22T12:40:22Z")

</div>

Hello everyone,  
I am having some problems to execute the processing-java on windows from nodejs. When I use the following

```auto
processing-java --sketch=$pwd/sketch/ --run

```

in the console it works fine and the sketch is executed, window opens and the result is a file written to a directory where I need it.

But when I use the same as a string in the node file to execute it, it does not open a window and no file has been written, but the callback function `processOutput` is executed, hence the somehow the execution happened.

I added  
`const exec = require('child_process').exec;`  
to the js file which is used for executing child processes in node.  
`$pwd` is the PowerShell equivalent to `pwd` on MacOS.  
`exec` should execute the shell command and call the callback function (which seems to happen)

```auto
const cmd = 'processing-java --sketch=$pwd/sketch/ --run';
exec(cmd, processOutput);

```

What am I missing? Any help appreceated.  
Many thanks, C.

---

<div class="post-metadata">

**Author:** ![cheister](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@cheister](https://discourse.processing.org/u/cheister)\
**Post date:** [November 4, 2020, 7:36am UTC](https://discourse.processing.org/t/calling-processing-java-from-node-on-windows-10/24819/2 "2020-11-04T07:36:30Z")

</div>

I solved it by exchanging the `$pwd` with `%CD%` to run it on windows.

```auto
const cmd = 'processing-java --sketch=%CD%/sketch/ --run';

```
