Client executing app on the server computer

Hello!

I need to open an application with a button, but with a twist. I know that it can be done by using system.util.execute function. But it only works when the client that presses the button has the program installed. So… It would be great if some client could press the button from whatever machine he is on and then the app would open on the Server machine.

Is it possible to be done? If so, how?

Thanks in advance!

Are you just looking to make a script execute? or actually execute and view a program running on the server?

If its the first option, you probably just need to move the script somewhere that runs on the gateway, like a tag script or MessageHandler maybe.

If you actually want to interact with the program on the server, I'm not sure if there is a route to do that.

1 Like

Sorry about the ignorance, but I’m trying to do this and I can’t make it work. What am I doing wrong here? The script does not fire.

When I tried to add this script directly to the button, like this:

I got an error saying that the system couldn’t find the specified application, but the path is correct.

Try adding double backslash in your path like shown below. Backslash is an escape character and can cause issues if used in a string literal.

system.util.execute(["C:\\Windows\\notepad.exe"])

As for the tag change script not executing, I'm not seeing anything obvious to me that might be causing it(other than the double slashes missing there) I would double check in the Gateway logs to see if there is any further error messages.

Yes, it was the double backlash! Thanks!

But now it’s oppening twelve notepads when I change from 0 to 1. Any clue why is this happening?

And the gateway tag change is still not firing :confused:

I would move the script away from property change and have it execute on 'actionPerformed' instead. I'm guessing there are more than one property change occurring when the button is clicked and that is why you are getting several notepad windows.

Can you post a screenshot for your tag change script settings(the configuration page for the tags not the script)?

1 Like

You mean this settings?

There is also something odd happening on the Gateway, it isn’t showing any scripts:

Hmm it should show there, I would double check that the project has been saved.

But I am running some tests on my side and can’t seem to get system.util.execute to run at the gateway level. It doesn’t error and the script seems to execute successfully though. The documentation says it should work at all scopes, so I’m not sure what is missing.

I’ve saved multiple times to make sure it would work. Maybe I should reset the gateway?

Yes, that’s weird, it really doesn’t show any errors. Perhaps I’ll post again on the forum asking specifically about this issue.

What are you trying to accomplish by opening the program on the server? In your first post you mentioned that you could open it from the clients only if they had the program installed so you wanted to open it on the server. Why do you want to open it on the server? Does the client that opened it need to interface with it or does the program just need to do something in the background with no user interface?

As for your post about it not showing up as a gateway tag change script. Looking at your posts you originally had it in a gateway tag change script but the last time you showed your script you had it in a tag event script. That will not show up in your gateway scripts. If you want to monitor it in your gateway scripts you need to move it back to a gateway tag change script.

I just need to run a app that interacts with Ignition by itself (Labview executable), so the client doesn’t need to interact with that app. It all happens on the background. Client just has to run the .exe and everything is fine.

I’ve changed it back to the gateway scripts, that was when I noticed that the project I was designing wasn’t enabled, that’s why it wasn’t showing on the the gateway scripts.

But I think someone on my other post found the solution. I’m trying to solve it right now.

Also, Windows will not allow any “background” service, no matter what user it’s running as, to open a foreground/GUI application like Notepad. Whatever program you want to run must run self-contained without any user interaction.

The actual program I want to run is a Labview executable. Without user interaction needed.

1 Like

@PGriffith do you know anything about this?

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?

http://forum.inductiveautomation.com/t/system-util-execute-on-the-gateway-scope/25358/5

1 Like