Platforms to show: All Mac Windows Linux Cross-Platform

ShellMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Shell MBS Util Plugin 19.2 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
The class in MBS Plugins to run executables.
Dim s As New ShellMBS

s.Execute "/usr/bin/whoami"
s.Wait 5

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

Break // see in debugger

MsgBox "whoami: "+output

Via input stream, we can send data to the process.
And via output and error streams, we can read data coming back.

While this class does the same as Shell class in Xojo, we have the possibility to add more in the future.
For now you can benefit from an alternative implementation with stderr and stdout as two streams. Also we feature terminate methods to kill the child process.

See also WindowsProcessMBS, WindowsShellExecuteAsAdminMBS and WindowsShellExecuteMBS (Windows only), ConsoleExecuteMBS and NSTaskMBS (Mac only).

This class has no sub classes.

Some examples using this class:

Blog Entries

Xojo Developer Magazine


Release notes

  • Version 23.5
    • Fixed Terminate in ShellMBS class for Windows to work better.
  • Version 23.0
    • Added Tag property to ShellMBS class.
    • Fixed ExitCode for ShellMBS class on Linux.
  • Version 21.2
  • Version 20.1
    • Fixed a bug in ShellMBS class when running applications on Windows with empty ApplicationName.
  • Version 19.5
  • Version 19.2

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

SharingPanelMBS   -   SignalHandlerMBS

The biggest plugin in space...