AfxRunfunction
Runs a program in a new process.
Syntax
PRIVATE FUNCTION AfxRun (BYREF wszCommand AS WSTRING, BYVAL WindowStyle AS LONG = 0, BYVAL WaitOnReturn AS BOOLEAN = FALSE) AS HRESULT
Parameters
| Name | Description | |
|---|---|---|
wszCommand | String value indicating the command line you want to run. You must include any parameters you want to pass to the executable file. | |
WindowStyle | Integer value indicating the appearance of the program's window. Note that not all programs make use of this information. | |
WaitOnReturn | Boolean value indicating whether the script should wait for the program to finish executing before continuing to the next statement in your script. If set to true, script execution halts until the program finishes, and Run returns any error code returned by the program. If set to false (the default), the Run method returns immediately after starting the program, automatically returning 0 (not to be interpreted as an error code). |
Return value
Returns S_OK or an HRESULT error code.
Description
Runs a program in a new process.
Examples
AfxRun (BYREF wszCommand AS WSTRING, BYVAL WindowStyle AS LONG = 0, BYVAL WaitOnReturn AS BOOLEAN = FALSE) AS HRESULT
AfxRun("Calc")
Reference
- Defined in AfxNova/AfxWsh.inc:196
- Documented in Windows/Windows Script/Windows Shell.md
- Topic: Windows Shell