# System.util.execute on the Gateway Scope

**URL:** <https://forum.inductiveautomation.com/t/system-util-execute-on-the-gateway-scope/25358>\
**Category:** Ignition\
**Created:** [May 28, 2019, 2:24pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-on-the-gateway-scope/25358 "2019-05-28T14:24:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![carolineuchoa.estuda](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@carolineuchoa.estuda](https://forum.inductiveautomation.com/u/carolineuchoa.estuda)\
**Post date:** [May 28, 2019, 2:24pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-on-the-gateway-scope/25358/1 "2019-05-28T14:24:16Z")

</div>

Hello!

I’m trying to open an application on the Gateway scope, using Gatway Tag Change Script. What I need is to change a button to 1 and then it opens notepad, but I need it to be on the Gateway.  
The script doesn’t show any erros, the wrapper.log doesn’t show any errors, and the script still doesn’t fire. The project is saved, so that’s not the issue.

That’s my script:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/678f20a92005ed2e51f9e23c1588a3fb991440c1.png)

Anyone has a clue of why it is not firing? I’ve posted about it before and the guy that tried to help me couldn’t make it run either. I’ve read that system.util.exec works on all scopes, but when I run the very same script on a button actionPerformed event, it runs perfectly. It looks like system.util is not working on the gateway scope. Anyone has any ideas?

Thanks in advance!

---

<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:** [May 28, 2019, 2:31pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-on-the-gateway-scope/25358/2 "2019-05-28T14:31:44Z")

</div>

The gateway runs as a service, and services or service users probably aren’t allowed to spawn GUI processes by default.

Someone more familiar with Windows might know if there’s a way to change that. I seem to remember there be a setting about allowing the service or service user to interact with the desktop?

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [May 28, 2019, 3:26pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-on-the-gateway-scope/25358/3 "2019-05-28T15:26:08Z")

</div>

If I understand correctly (also from reading your other post), you want to execute a program from client, but program is installed on the server, not on the client.  
I’ve done this in the past:

1. the program you want to run, must be in the shared folder on the server
2. if the server and the client aren’t on the same domain, then on the server you must create a user which you are using on the client (same name and password)
3. the user must have read (and write if you need) rights on the shared folder

You can test if everything is OK like this:

- on the client PC open File Explorer and go to the network and open the server
- the shared folder must be showing and inside must be your app.exe.
- double click on the exe file

This was my code (on the button actionPerformed) for running the program on the server from client:

```auto
if system.file.fileExists("\\\\10.64.33.116\\omg\\OMG.BenderOne.Application.exe"):
	'print "exists!"
	system.util.execute(["\\\\10.64.33.116\\omg\\OMG.BenderOne.Application.exe"])
else:
	system.gui.errorBox("Error running the app from the server!")

```

The IP address is the server IP, because my client doesn’t have DNS server defined…

---

<div class="post-metadata">

**Author:** ![carolineuchoa.estuda](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@carolineuchoa.estuda](https://forum.inductiveautomation.com/u/carolineuchoa.estuda)\
**Post date:** [May 28, 2019, 4:43pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-on-the-gateway-scope/25358/4 "2019-05-28T16:43:46Z")

</div>

Thanks for your response.

There is an already existant shared folder between the Server and the Clients at my company. What I did was copy notepad to this shared folder and try to execute it as you told.  
But when I press the button it kind of gets ultra delayed (loading circle) and doesn’t open any programs. No errors was shown. Maybe it is the issue of services not being able to interact with the desktop, as Kevin mentioned?

Any clue?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/3/39a28c56bb1ec8e605e24bd28d37fcb1a8dc556f.png)

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [May 28, 2019, 5:11pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-on-the-gateway-scope/25358/5 "2019-05-28T17:11:00Z")

</div>

![AllowServicesToInteractWithDesktop](https://us1.discourse-cdn.com/inductiveautomation/original/2X/3/39674b9c221d55edf6c187ac7ec64d5dd338d5c0.png)

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [May 28, 2019, 5:14pm UTC](https://forum.inductiveautomation.com/t/system-util-execute-on-the-gateway-scope/25358/6 "2019-05-28T17:14:55Z")

</div>

That means that user on the client doesn’t have necessary permissions on the shared folder.  
When you do it this way then Ignition service doesn’t interact with the program. Your client is…

Until you can’t execute/run the program from File Explorer/Network/server/sharedFolder, you can’t run it from client with system.util.execute…
