Click or drag to resize

_Run Function

X#
Execute a Windows or DOS application, a batch file, or a DOS command.

Namespace:  XSharp.VO
Assembly:  XSharp.VO (in XSharp.VO.dll) Version: 2.19
Syntax
 FUNCTION _Run(
	cProgram AS STRING
) AS DWORD
Request Example View Source

Parameters

cProgram
Type: String
The command line (file name plus optional parameters) for the application to be executed. If the name of the executable file in the lpCmdLine parameter does not contain a directory path, the system searches for the executable file in this sequence:
1) The directory from which the application loaded.
2) The current directory.
3) The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
4) The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
5) The directories listed in the PATH environment variable.

Return Value

Type: DWord
If the function succeeds, the return value is greater than 31. f the function fails, the return value is one of the following error values. Return code/valueDescription 0 The system is out of memory or resources. ERROR_BAD_FORMAT (1) The .exe file is invalid.ERROR_FILE_NOT_FOUND (2) The specified file was not found. ERROR_PATH_NOT_FOUND (3)The specified path was not found
Remarks
This function uses the WinExec() function from the windows api. The security issues as mentioned there are also valid for this function.
See Also