Launching an executable from a Gateway Startup Script

I have an .exe that needs to run on the Gateway computer. I am trying to start the .exe from a Gateway Startup Script using

system.util.execute([“C:\Program Files (x86)\Seagull\BarTender Suite\bartend.exe”,"/F=C:\Users\admin\Documents\BarTender\BarTender Documents\Test.btw", “/MIN”])

The code works from a button event handler, and from a Client Timer Script, if the Ignition project is running on the server. It does not work from a Gateway Timer Script. Any ideas?

That software needs to be installed and in that location on the gateway machine if you’re going to run it from a gateway timer script. Is that the case?

Client timer scripts and button even handlers run on the machine running the client and designer.

Yes that is the case. The only time the button or Client Timer Script work is if the Ignition project is running on the Gateway computer.

I have also tried placing a try…except in the code to see an error, but it seems to go through error free. It just doesn’t launch the program.

The Ignition service runs under a different account and session than the interactive user. Typically, Ignition runs under the local system account in session 0.

Look at the Microsoft psexec utility that will allow specifying the account and session to run a program with.

1 Like

I’m not familiar with this. I’ll do my homework and post a reply.

In working on the psexec utility I found that my original program was starting the process in the background under the SYSTEM user.

Thanks for pointing me in the right direction.