# I need assistance with the exec node

**URL:** https://discourse.nodered.org/t/i-need-assistance-with-the-exec-node/97793
**Category:** General
**Tags:** exec
**Created:** [25 June 2025 14:28 UTC](https://discourse.nodered.org/t/i-need-assistance-with-the-exec-node/97793 "2025-06-25T14:28:10Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![mahsh](https://avatars.discourse-cdn.com/v4/letter/m/c77e96/32.png) [@mahsh](https://discourse.nodered.org/u/mahsh)
#### Post date: [25 June 2025 14:28 UTC](https://discourse.nodered.org/t/i-need-assistance-with-the-exec-node/97793/1 "2025-06-25T14:28:10Z")

</div>

**Hi, I'm running Node-RED on Windows and using the "exec" node with the following command to get `.jpg` file modification details:**

```auto
stat -c "%z %s %n" --

```

**Here's the issue I'm facing:**

- In the **first iteration** , I modify one `.jpg` file using Microsoft Paint, save it, and then run the command. The output from the exec node correctly shows the updated timestamp, which matches the file’s "Date Modified" in Windows file properties.
- In the **second iteration** , I modify a **different** `.jpg` file and run the command again. The output now shows the correct updated timestamp for the newly modified file — **but strangely, the timestamp for the first file also changes** , even though I didn’t modify it.
- What’s more unusual is that the first file’s new timestamp is about **2 seconds earlier** than the second (actually modified) file.
- This new timestamp for the first file does **not** match what's shown in Windows file properties (it still shows the original modification time there).

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [25 June 2025 14:33 UTC](https://discourse.nodered.org/t/i-need-assistance-with-the-exec-node/97793/2 "2025-06-25T14:33:50Z")

</div>

Hi and welcome to the forum.

The `stat` command is a Linux command rather than Windows, can you perhaps explain a little more about your configuration and where things are running?

---

<div class="post-metadata">

### Author: ![mahsh](https://avatars.discourse-cdn.com/v4/letter/m/c77e96/32.png) [@mahsh](https://discourse.nodered.org/u/mahsh)
#### Post date: [25 June 2025 15:13 UTC](https://discourse.nodered.org/t/i-need-assistance-with-the-exec-node/97793/3 "2025-06-25T15:13:48Z")

</div>

The node red is running on rancher desktop.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [25 June 2025 15:15 UTC](https://discourse.nodered.org/t/i-need-assistance-with-the-exec-node/97793/4 "2025-06-25T15:15:26Z")

</div>

Sorry but I've no idea what "rancher desktop" is.

---

<div class="post-metadata">

### Author: ![mahsh](https://avatars.discourse-cdn.com/v4/letter/m/c77e96/32.png) [@mahsh](https://discourse.nodered.org/u/mahsh)
#### Post date: [25 June 2025 15:23 UTC](https://discourse.nodered.org/t/i-need-assistance-with-the-exec-node/97793/5 "2025-06-25T15:23:21Z")

</div>

Rancher basically provides Kubernetes and container management environment on our local system.

---

<div class="post-metadata">

### Author: ![mahsh](https://avatars.discourse-cdn.com/v4/letter/m/c77e96/32.png) [@mahsh](https://discourse.nodered.org/u/mahsh)
#### Post date: [25 June 2025 15:33 UTC](https://discourse.nodered.org/t/i-need-assistance-with-the-exec-node/97793/6 "2025-06-25T15:33:40Z")

</div>

I guess running linux command is not a problem as we have installed Windows Subsystem for Linux (WSL). So, we didn't face any issue in running 'stat'.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [25 June 2025 15:35 UTC](https://discourse.nodered.org/t/i-need-assistance-with-the-exec-node/97793/7 "2025-06-25T15:35:03Z")

</div>

OK, so you still haven't actually described your configuration and I can't help without more info.

> [@mahsh](#):
>
> I guess running linux command is not a problem as we have installed Windows Subsystem for Linux (WSL). So, we didn't face any issue in running 'stat'.

Right, now we have a little more info but I still don't know how you are actually running things.

Are you saying that you have Windows running in a container which, in turn is running WSL? Where is Node-RED running?

---

<div class="post-metadata">

### Author: ![mahsh](https://avatars.discourse-cdn.com/v4/letter/m/c77e96/32.png) [@mahsh](https://discourse.nodered.org/u/mahsh)
#### Post date: [25 June 2025 15:38 UTC](https://discourse.nodered.org/t/i-need-assistance-with-the-exec-node/97793/8 "2025-06-25T15:38:48Z")

</div>

Yes you are right..

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [25 June 2025 15:42 UTC](https://discourse.nodered.org/t/i-need-assistance-with-the-exec-node/97793/9 "2025-06-25T15:42:31Z")

</div>

OK, well, that is a slightly mad setup! Why not simply run Linux in a container? Would be vastly more performant and a lot simpler to manage.

This feels like a caching issue but very hard to say given the complex environment. And WSL is not meant to be used for live environments either.

And you still haven't told me where Node-RED is running? On the host, in the Windows container or in the WSL container in the Windows container?

---

<div class="post-metadata">

### Author: ![mahsh](https://avatars.discourse-cdn.com/v4/letter/m/c77e96/32.png) [@mahsh](https://discourse.nodered.org/u/mahsh)
#### Post date: [25 June 2025 15:50 UTC](https://discourse.nodered.org/t/i-need-assistance-with-the-exec-node/97793/10 "2025-06-25T15:50:32Z")

</div>

ok let me try to answer this... as per my understanding node red is running on a container management system on local machine called "rancher desktop" & infact rancher desktop is running on WSL container in window OS.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [25 June 2025 19:20 UTC](https://discourse.nodered.org/t/i-need-assistance-with-the-exec-node/97793/11 "2025-06-25T19:20:49Z")

</div>

I'm sorry but that doesn't really make sense.

The ["rancher desktop"](https://rancherdesktop.io) is a container manager that runs on a host OS. Node-RED is a node.js app (code that is executed by the node.js application) which requires an OS to run under. WSL is a Linux environment that runs under a Windows OS.

- Host OS (Windows?) - _Is Node-RED/node.js running here?_
  - --\> Rancher Desktop (container manager)
    - --\> Containerised OS (Windows?) - _Or is Node-RED/node.js running here?_
      - --\> WSL (lightweight Linux container) - _or is Node-RED running here?_

In addition to knowing where Node-RED is running, which OS (the host, the container or WSL) is hosting the image files?

If at all possible, please try to simplify your architecture because you have at least 1 or 2 too many layers which is making things far too complex and is most likely the root cause of your issues.

Almost certainly not really a Node-RED issue by the way.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [25 June 2025 21:31 UTC](https://discourse.nodered.org/t/i-need-assistance-with-the-exec-node/97793/12 "2025-06-25T21:31:17Z")

</div>

Are you working on your own personal computer or a company/college one?

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [25 June 2025 23:24 UTC](https://discourse.nodered.org/t/i-need-assistance-with-the-exec-node/97793/13 "2025-06-25T23:24:24Z")

</div>

By the way, we've not even got into better ways to get the file info. Node.js has its own libraries which will likely be a lot more effective. They can be used with a function node.

But until we know how your setup is actually structured, we still can't really help.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [23 September 2025 23:24 UTC](https://discourse.nodered.org/t/i-need-assistance-with-the-exec-node/97793/14 "2025-09-23T23:24:57Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
