Liquid UI - Documentation - 7.15 ShellExecute()

7.15 ShellExecute()


Purpose

With ShellExecute(), you can run programs, where it allows you to perform system-level operations, such as opening a browser, opening a program (for example, notepad), accessing clipboard data, and so on.


Options

The ShellExecute() does not take any options.


Example

The following example demonstrates the usage of the ShellExecute command. On execution of the following script on the SAP Easy Access screen script file, the following actions occur:

  • The browser opens the website specified - www.guixt.com
    pushbutton([TOOLBAR],'Copy to Clipboard','?',{'process':copyClipBoard,'size':[1,20]})
    function copyClipBoard()
    {
    system.ShellExecute('iexplore.exe','http://www.guixt.com');
    }
    
     

     
  • Opens notepad on your computer
    pushbutton([TOOLBAR],'Copy to Clipboard','?',{'process':copyClipBoard,'size':[1,20]})
    function copyClipBoard()
    {
    system.ShellExecute('notepad.exe');  // Opens Notepad
    // system.ShellExecute('notepad.exe', 'C:\\customers\\AAF\\filename.txt');
    // Opens Specified File in Notepad }
     

     
  • Copy the contents from clipboard to file.
    pushbutton([TOOLBAR],'Copy to Clipboard','?',{'process':copyClipBoard,'size':[1,20]})
    function copyClipBoard()
    {
    system.ShellExecute('cmd.exe','/C type c:\\customers\\AAF\\filename.txt|clip','open',SW_HIDE=0');
    }
    
     

     

Can't find the answers you're looking for?