System.util.execute run as administrator

I am trying to run an OPC application from a gateway script, but it requires to right click on to run as administrator to open properly. How can I do this with system.util.execute(path) or some other function?

Running from script console (logged in as a windows admin) I get no Ignition errors but the encyption error pops up for the application indicating that it isn’t being run as an admin and if I change compatibility properties to run this program as an administrator for all users I get this: Cannot run program (path) CreateProcess error=740, The requested operation requires elevation.

When running the same code in a tag change script, nothing happens, no error, no activity in logs either way.

The OPC application is Advosol uaPlus.

Take a look here:
how to run a program as administrator via the command line

Is there a different way to handle this from within Ignition?
I set this application to always run as administrator for all users… But I still get the error.

Posting this here because I found a solution that worked for me.

My goal was to run a batch script to restart a Windows service, but I couldn’t get the command to run due to privilege issues. I created a windows task that runs the batch script and set it to run as one of the system accounts that has the necessary permissions, then I use system.util.execute to run the task:

system.util.execute(['schtasks.exe', '/run', '/tn', 'task_name'])
1 Like