Liquid UI - WS Reference Library

ShellExecute()


Purpose

With ShellExecute(), you can run programs.

Using ShellExecute() command, you can perform system level operations, such as opening a browser, opening a program(for example, notepad), accessing clipboard data, and so on.


Options

ShellExecute() command does not take any options.


Example

The following example demonstrates the usage of ShellExecute() command.

On execution of the following script, the following actions occur:

  • Browser opens the website - www.guixt.com
  • Opens notepad on your computer
  • Copy the contents from clipboard to file


Script

pushbutton([TOOLBAR],'Copy to Clipboard','?',{'process':copyClipBoard,'size':[1,20]})
function copyClipBoard()
{
system.ShellExecute('iexplore.exe','http://www.guixt.com');  // Opens Web Browser with specified link
// system.ShellExecute('notepad.exe');  // Opens Notepad
// system.ShellExecute('notepad.exe', 'C:\\customers\\AAF\\filename.txt');
// Opens Specified File in Notepad //system.ShellExecute('cmd.exe','/C type c:\\customers\\AAF\\filename.txt|clip','open',SW_HIDE=0');
}