# Execute dos command in node-red

**URL:** <https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809>\
**Category:** General\
**Created:** [29 March 2020 02:22 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809 "2020-03-29T02:22:17Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Munier](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Munier](https://discourse.nodered.org/u/Munier)\
**Post date:** [29 March 2020 07:31 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/22 "2020-03-29T07:31:01Z")

</div>

With the suggested modification I still get the same error message. IMPL has it own path in C:\IMPL

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [29 March 2020 07:32 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/23 "2020-03-29T07:32:37Z")

</div>

As said, I dont know if you need escaped double backslashes or forward slashes

Try it like this

 ![Screenshot 2020-03-29 at 09.33.16](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/8/48efc67fac29049b8314fe9457b23346926b9710.jpeg)

note the double backslashes also in the fact part.

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [29 March 2020 08:42 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/24 "2020-03-29T08:42:49Z")

</div>

Double quotes?

Maybe this article is helpful?

> <https://superuser.com/questions/1213094/how-to-escape-in-cmd-exe-c-parameters>

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [29 March 2020 08:45 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/25 "2020-03-29T08:45:01Z")

</div>

When you run it in a terminal do you actually type `C:\IMPL> impl -fact=....`? I think it more likely that the `C:\IMPL>` is there already and you just type the command. You shouldn't have the `C:\IMPL>` specified in the exec node. So I think what you need may be (I am sure I have seen it here that you can use forward slashes)  
`c:/IMPL/impl -fact=c:/IMPL/HeatExchanger/.....`  
Are you sure about the `=filter=quality` bit? I would have expected that to be `-filter=quality`

---

<div class="post-metadata">

**Author:** ![Munier](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Munier](https://discourse.nodered.org/u/Munier)\
**Post date:** [30 March 2020 02:27 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/26 "2020-03-30T02:27:31Z")

</div>

> [@krambriw](#):
>
> Double quotes

I have tried double quotes, it didn't work.

---

<div class="post-metadata">

**Author:** ![Munier](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Munier](https://discourse.nodered.org/u/Munier)\
**Post date:** [30 March 2020 02:35 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/27 "2020-03-30T02:35:31Z")

</div>

> [@Colin](#):
>
> =filter=quality

Yes `=filter=quality` is correct.  
Here is what I get

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/6/c630b1084a5494d6c6e497c1f50854e7c2455dee.png)

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [30 March 2020 05:41 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/28 "2020-03-30T05:41:56Z")

</div>

It might be caused by the command itself in the command field.

If you set the command to `c:\\IMPL\\impl` and remove (cut) the rest. Check the "append msg.payload" checkbox.  
Change the inject node to string and paste the parameters.

---

<div class="post-metadata">

**Author:** ![Munier](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Munier](https://discourse.nodered.org/u/Munier)\
**Post date:** [30 March 2020 06:02 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/29 "2020-03-30T06:02:43Z")

</div>

> [@bakman2](#):
>
> paste the parameters

You mean pasting the rest of the command in the parameters i.e., ` -fact=C:\\IMPL\\HeatExchanger\\MassBalancing =filter=quality -fork=secqpe_y12m`?

the actual command is `impl -fact=C:\IMPL\HeatExchanger\MassBalancing =filter=quality -fork=secqpe_y12m`  
I execute this command through IMPL directory i.e., `C:\IMPL>`

I did follow your suggestion but I get the same error message.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [30 March 2020 06:06 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/30 "2020-03-30T06:06:26Z")

</div>

Change the debug node and check the "system console" checkbox.  
Click the inject button and check the node-red log (on windows you may need to stop node-red and start it from command line so you will see the output in the cmd window, click the inject button and check the full output).

---

<div class="post-metadata">

**Author:** ![Munier](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Munier](https://discourse.nodered.org/u/Munier)\
**Post date:** [30 March 2020 06:21 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/31 "2020-03-30T06:21:47Z")

</div>

> [@bakman2](#):
>
> Click the inject button and check the node-red log

How can I do that?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/5/e58ec6610c7b8d16f36f6edca5e1b60124f561c9.png)

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [30 March 2020 06:26 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/32 "2020-03-30T06:26:00Z")

</div>

> check the node-red log (on windows you may need to stop node-red and start it from command line so you will see the output in the cmd window, click the inject button and check the full output

---

<div class="post-metadata">

**Author:** ![Munier](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Munier](https://discourse.nodered.org/u/Munier)\
**Post date:** [30 March 2020 06:31 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/33 "2020-03-30T06:31:37Z")

</div>

I get the same result as to what was in node-red workspace

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/6/168e0ff5c1f1b60a8e07f93d90877ac0e0dcc0f2.png)

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [30 March 2020 06:33 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/34 "2020-03-30T06:33:53Z")

</div>

Well no: missing settings file

Debug in the browser shows a limited number of characters, on the commandline you see the full output.

---

<div class="post-metadata">

**Author:** ![Munier](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Munier](https://discourse.nodered.org/u/Munier)\
**Post date:** [30 March 2020 06:44 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/35 "2020-03-30T06:44:47Z")

</div>

> [@bakman2](#):
>
> on the commandline you see the full output.

I am a bit lost here. there is error message that says "ERROR - Missing settings file." in the output of window's cmd.

I want to debug this `{ code: 1, message: 'Command failed: C:\\IMPL\\impl -fact=C:\\IMPL\\HeatExchanger\\MassBalancing =filter=quality -fork=secqpe_y12m\n' + '1\r\n' }` if it pass this then I can run the model I have in IMPL

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [30 March 2020 06:59 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/36 "2020-03-30T06:59:58Z")

</div>

You receive `code: 1` because there is an error: `ERROR - Missing settings file`

Try this flow

```auto
[{"id":"a7a164f8.922c6","type":"inject","z":"60c87e10.fd2978","name":"","topic":"","payload":"-fact=C:\\\\IMPL\\\\HeatExchanger\\\\MassBalancing =filter=quality -fork=secqpe_y12m","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":158,"y":936,"wires":[["801c90b9.314e88"]]},{"id":"801c90b9.314e88","type":"exec","z":"60c87e10.fd2978","command":"c:\\\\IMPL\\\\impl","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":390,"y":936,"wires":[["5af06f3e.b82428"],["818cf7.a9159b08"],["405094fc.36de94"]]},{"id":"5af06f3e.b82428","type":"debug","z":"60c87e10.fd2978","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":626,"y":888,"wires":[]},{"id":"818cf7.a9159b08","type":"debug","z":"60c87e10.fd2978","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":626,"y":960,"wires":[]},{"id":"405094fc.36de94","type":"debug","z":"60c87e10.fd2978","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":626,"y":1032,"wires":[]}]

```

Same error ?

---

<div class="post-metadata">

**Author:** ![Munier](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Munier](https://discourse.nodered.org/u/Munier)\
**Post date:** [30 March 2020 07:25 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/37 "2020-03-30T07:25:22Z")

</div>

> [@bakman2](#):
>
> Same error ?

Yes, I removed the rest of the command `-fact=C:\\\\IMPL\\\\HeatExchanger\\\\MassBalancing =filter=quality -fork=secqpe_y12m` from the extra input parameters tab in the exec node and past it in payload tab of the inject node that is defined as string.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/f/ff749ec5f67459b007f034f563b2004dc99f1a8a.png)  
Is that how you want me to configure the flow. The error is still the same -- "Missing setting file".

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [30 March 2020 07:34 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/38 "2020-03-30T07:34:28Z")

</div>

It sounds like some kind environment settings. Is there a help option on the `impl` command ? (like `impl -?` or `impl /?`)

---

<div class="post-metadata">

**Author:** ![Munier](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Munier](https://discourse.nodered.org/u/Munier)\
**Post date:** [30 March 2020 07:51 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/39 "2020-03-30T07:51:09Z")

</div>

Unfortunately, there isn't help documentation for IMPL. Its is a software which is mainly used for production optimization it is all based on CSV files i.e., notepad++

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 March 2020 08:10 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/40 "2020-03-30T08:10:19Z")

</div>

Have you tried it with all single forward slashes as I previously suggested?

---

<div class="post-metadata">

**Author:** ![Munier](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Munier](https://discourse.nodered.org/u/Munier)\
**Post date:** [30 March 2020 08:16 UTC](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809/41 "2020-03-30T08:16:51Z")

</div>

Yes, I have tried it with single forward slashes. Actually both the back and forward slashes show the same output, see below.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/3/b310b36464a5b9dc0062cc595854fe46eac74f7c.png)

[Previous page](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809.md?page=1)

[Next page](https://discourse.nodered.org/t/execute-dos-command-in-node-red/23809.md?page=3)
