Skip to main content
Version: 7.9

system.util.execute

This function is used in Python Scripting.

Description​

Executes the given commands via the operating system, in a separate process. The commands argument is an array of strings. The first string is the program to execute, with subsequent strings being the arguments to that command.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.util.execute(commands)

Parameters​

TypeParameterDescription
String[]commandsA list containing the command (1st entry) and associated arguments (remaining entries) to execute.

Returns​

Nothing

Scope​

All

Code Examples​

Example #1
# This code starts the Firefox browser and opens the Google home page.
system.util.execute(['C:\\Program Files\\Mozilla Firefox\\firefox.exe', 'https://www.google.com'])
Example #2
# This function flushes the resolver cache.
system.util.execute(["ipconfig", "/flushdns"])
Example #3
# This code runs the Notepad program and opens the Ignition license text file.
system.util.execute(['notepad.exe', 'c:\\program files\\inductive automation\\ignition\\license.txt'])