Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: examples updated per sales req


Scripting_function



Panel
titleDescription

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.


Panel
titleClient Permission Restrictions

This scripting function has no Client Permission restrictions.


Panel
titleSyntax

system.util.execute(commands)

  • Parameters

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

  • Returns

nothing

  • Scope

All



Panel
titleCode Examples


Code Block
languagepy
titleCode Snippet
# 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'])


Code Block
languagepy
titleCode Snippet
# This function flushes the resolver cache.
system.util.execute(["ipconfig", "/flushdns"])


would work on a Windows system to play a sound
Code Block
languagepy
titleCode Snippet
# This code runs the Notepad program and opens the Ignition license text file.
system.util.execute(["sndrec32", "/play", "/close", "/embedding", "C:\\somethingwrong.wav"'notepad.exe', 'c:\\program files\\inductive automation\\ignition\\license.txt'])