Platforms to show: All Mac Windows Linux Cross-Platform

Back to ShellMBS class.

ShellMBS.Arguments as String()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Shell MBS Util Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Queries arguments array.
Example
// query execution policy in PowerShell
Dim s As New ShellMBS

s.Arguments.Append "-Command"
s.Arguments.Append "Get-ExecutionPolicy -List"

s.Execute "powershell.exe"
s.Wait 5

Dim output As String = s.ReadOutput
Dim errors As String = s.ReadError

Break // see in debugger

You can add arguments to this array.

ShellMBS.CloseInput

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Shell MBS Util Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Closes stdin to the process.

Sometimes this is needed as some processes wait till stdin is closed.

ShellMBS.CloseStreams

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Shell MBS Util Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Closes the streams.

Automatically done in destructor.

ShellMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Shell MBS Util Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
The constructor.

ShellMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Shell MBS Util Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
The destructor.

ShellMBS.Execute(Executable as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Shell MBS Util Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Runs the executable.
Example
// run PowerShell and get help
Dim s As New ShellMBS

s.SetArguments array("/?")
s.Execute "powershell.exe"
s.Wait 5

Dim output As String = s.ReadOutput
Dim errors As String = s.ReadError

Break // see in debugger

Pass path to executable to run.
Opens the streams stdin, stdout and stderr.

ShellMBS.ExitCode as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Shell MBS Util Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Queries the exit code of the terminated process.

ShellMBS.Poll

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Shell MBS Util Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Polls for events.

This will check for pending event and fire events if needed.
Internally we call this with a timer for the shell object, but you can call this in a tight loop.

ShellMBS.ReadError as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Shell MBS Util Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Reads data from stderr.

Queries available bytes to return all the data in the buffer.

ShellMBS.ReadOutput as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Shell MBS Util Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Reads data from stdout.

Queries available bytes to return all the data in the buffer.

ShellMBS.SetArguments(arguments() as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Shell MBS Util Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Assigns a new array of arguments.
Example
Dim sh as new ShellMBS
Dim args() As String

args.Append "-c"
args.Append "5"
args.Append "monkeybreadsoftware.com"

sh.SetArguments args

ShellMBS.Terminate(WinExitCode as Integer = 255) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Shell MBS Util Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Terminates the app with the given exit code.

ExitCode is only used on Windows.
Returns true on success.

ShellMBS.Wait(TimeOut as double = 30.0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Shell MBS Util Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Waits for process to quit.

Yields time and waits until time passed or process terminates.

ShellMBS.WriteInput(data as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Shell MBS Util Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
Sends data to stdin of the running process.

Returns number of bytes written.

The items on this page are in the following plugins: MBS Util Plugin.


The biggest plugin in space...