# System.util.execute, command string

**URL:** <https://forum.inductiveautomation.com/t/system-util-execute-command-string/66371>\
**Category:** Ignition\
**Tags:** ignition81, scripting, perspective\
**Created:** [November 10, 2022, 9:28pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-command-string/66371 "2022-11-10T21:28:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![NII](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nii/32/12920_2.png) [@NII](https://forum.inductiveautomation.com/u/NII)\
**Post date:** [November 10, 2022, 9:28pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-command-string/66371/1 "2022-11-10T21:28:41Z")

</div>

I do

system.util.execute(["/usr/local/bin/ignition/data/TJ/python3 myio.py"])

but it gives an error

> Blockquote  
> java.io.IOException: Cannot run program "/usr/local/bin/ignition/data/TJ/python3 myio.py": CreateProcess error=2, The system cannot find the file specified

The file does exist. What command string should I use to run myio.py?  
Note, I am running ignition in a raspberry pi.

---

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [November 10, 2022, 10:20pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-command-string/66371/2 "2022-11-10T22:20:43Z")

</div>

Are you running the client on the same computer as the gateway? Which computer has `/usr/local/bin/ignition/data/TJ/python3 myio.py`? Perspective will only look on the gateway computer.

---

<div class="post-metadata">

**Author:** ![NII](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nii/32/12920_2.png) [@NII](https://forum.inductiveautomation.com/u/NII)\
**Post date:** [November 10, 2022, 11:17pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-command-string/66371/3 "2022-11-10T23:17:16Z")

</div>

It's running at the gateway.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 11, 2022, 9:12pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-command-string/66371/4 "2022-11-11T21:12:03Z")

</div>

Those should be 2 separate elements in the array, i.e.

```auto
system.util.execute(["/usr/local/bin/ignition/data/TJ/python3", "myio.py"])

```

---

<div class="post-metadata">

**Author:** ![NII](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nii/32/12920_2.png) [@NII](https://forum.inductiveautomation.com/u/NII)\
**Post date:** [November 12, 2022, 6:38pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-command-string/66371/5 "2022-11-12T18:38:01Z")

</div>

I'm still getting the same error.

tried below, also same error

> Blockquote  
> system.util.execute(["/usr/local/bin/ignition/data/TJ/ls"])

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 12, 2022, 6:51pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-command-string/66371/6 "2022-11-12T18:51:43Z")

</div>

What’s the exact error?

What scope are you running this from? It looks like you have python3 installed on the Gateway, so running it from the designer script console, for example, will not work. The path to the file you’re trying to execute may also be relative to the Ignition dir, so you might need to either make it absolute or account for that.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 12, 2022, 7:09pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-command-string/66371/7 "2022-11-12T19:09:36Z")

</div>

> [@NII](#):
>
> system.util.execute(["/usr/local/bin/ignition/data/TJ/ls"])

Why would you expect this to work? Did you install the `ls` executable in that folder?

Is python3 installed in that folder? You need the path to the executable.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [November 12, 2022, 7:10pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-command-string/66371/8 "2022-11-12T19:10:30Z")

</div>

> [@NII](#):
>
> Blockquote

Tip: Use the \</\>` Preformatted Text button for code, not the " Blockquote button.

---

<div class="post-metadata">

**Author:** ![NII](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nii/32/12920_2.png) [@NII](https://forum.inductiveautomation.com/u/NII)\
**Post date:** [November 12, 2022, 9:39pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-command-string/66371/9 "2022-11-12T21:39:59Z")

</div>

Aah, got you! Thanks pturmel for the clue.

Change it to

```auto
system.util.execute(["python3", "/usr/local/bin/ignition/data/TJ/"myio.py"])

```

Thanks to Transistor for the tip.
