Run an external program, returning its operating system task ID number
Util.ShellExec(Program, [CommandLine], [WindowState])
The method syntax has these parts:
| Part | Description |
|---|---|
| Program (String) | The full path/name of the executable or batch file to run (or using %PATH% for resolution) |
| CommandLine (String) | command line arguments to be passed to the program (default = nothing) |
| WindowState (ShellWindowState) | Optional. The initial state of the program's main window (or the console window if the program is a command-line application, (default minimized with focus, swMinimizedFocus). |
| Return (Long) | task identification number of the external program -- assigned by the operating system |
For running programs as Administrator (Windows 7/8) use Util.ShellExecAdmin().
The (symbolic) values for ShellWindowState are:
| Constant | Value | Description |
|---|---|---|
| swHide | 0 | The task window is hidden. |
| swMaximizedFocus | 3 | The task window is initially displayed maximized and given the focus. |
| swMinimizedFocus | 2 | The task window is initially displayed minimized and given the focus. |
| swMinimizedNoFocus | 6 | The task window is initially displayed minimized but not given the focus. |
| swNormalFocus | 1 | The task window is initially displayed as a normal window and given the focus. |
| swNormalNoFocus | 4 | The task window is initially displayed as a normal window but not given the focus. |