<< Click to Display Table of Contents >> Navigation: ThinBASIC Core Language > BuiltIn Functions > General functions > Shell |
Description
Creates a new process and its primary thread.
Syntax
Result = Shell(ApplicationName, CommandLine [, AsyncExecution])
Returns
Number, the exit code of the called process.
Parameters
Name |
Type |
Optional |
Meaning |
ApplicationName |
String |
No |
The name of the module to be executed.
This module can be a Windows-based application. It can be some other type of module if the appropriate subsystem is available on the local computer.
The string can specify the full path and file name of the module to execute or it can specify a partial name. In the case of a partial name, the function uses the current drive and current directory to complete the specification.
The function will not use the search path. This parameter must include the file name extension; no default extension is assumed.
The ApplicationName parameter can be an empty string: in that case, the module name must be the first white space–delimited token in the CommandLine string.
If you are using a long file name that contains a space, use quoted strings to indicate where the file name ends and the arguments begin. |
CommandLine |
String |
No |
Command line to execute
The maximum length of command line string is 32,768 characters |
AsyncExecution |
Number |
Yes |
If not indicated, Shell will execute in sync mode, it means it will wait untill executed process will finish. If %TRUE will be indicated, Shell function will exit immediately withou waiting process to finish it execution. |
Remarks
The new process runs in the security context of the calling process.
Additional info: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa
Restrictions
By default Shell is a synchronous function: it will wait until executed process is finished.
Unless %TRUE is passes in AsyncExecution parameter.
See also
Examples