Shell provides methods to start new processes and run other applications. The execution is asynchronous. The ProcessCompleted event is raised after the process has exited.
Events:
ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String) StdOut (Buffer() As Byte, Length As Int) StdErr (Buffer() As Byte, Length As Int)
Initializes the object. EventName - Determines the sub that will handle the events. Executable - Executable file to run. Args - List of command line arguments. Pass Null if not needed.
Gets or sets whether the process input stream will be open for communication. You can use WriteToInputStream to write data while the process is running.
IsInitializedAsBoolean
KillProcess
Kills the process if it is currently running.
Run (TimeoutMsAsLong)
Starts the process. TimeoutMs - Timeout in milliseconds. Pass -1 to disable the timeout.
Starts the process. The StdOut and StdErr events will be raised when new data is available. Note that these events are raised on a background thread.
SetEnvironmentVariables (VarsAsMap)
Set the system environment variables that will be passed to the child process. Example: shl.SetEnvironmentVariables(CreateMap("ZZZ": "abc", "YYYY": "213"))