# System.util.execute shell script and exit codes

**URL:** <https://forum.inductiveautomation.com/t/system-util-execute-shell-script-and-exit-codes/79116>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [September 13, 2023, 8:12pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-shell-script-and-exit-codes/79116 "2023-09-13T20:12:23Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [September 13, 2023, 10:25pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-shell-script-and-exit-codes/79116/2 "2023-09-13T22:25:56Z")

</div>

See this discussion earlier today:

> [@System.util.execute() does not work when executing .bat](https://forum.inductiveautomation.com/t/system-util-execute-does-not-work-when-executing-bat/79074):
>
> Hello everyone. I'm trying to execute a .bat file on my gateway, but it's not working. I've tried many different ways of writing it and different paths, I've done a lot of research on the forum, and I've also tried creating a shortcut with the "Run as administrator" option checked, but without success. Could you help me? Here are some of the commands I've tried: system.util.execute(['cmd.exe', '/C', 'C:/Program Files/Inductive Automation/Ignition/batfile/Shortcut']) system.util.execute(["cm…

---

_[View the full topic](https://forum.inductiveautomation.com/t/system-util-execute-shell-script-and-exit-codes/79116)._
