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 |
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).
- 2 events
- event Completed
- event DataAvailable(AvailableBytesError as Integer, AvailableBytesOutput as Integer)
- 16 properties
- property ApplicationName as String
- property AvailableBytesError as Integer
- property AvailableBytesOutput as Integer
- property CurrentDirectory as String
- property Domain as String
- property Environment as Dictionary
- property ErrorCode as Integer
- property Executable as String
- property IsRunning as Boolean
- property MergeErrorAndOutput as Boolean New in 25.0
- property Password as String
- property PID as Integer
- property ProcessHandle as Integer
- property Tag as Variant
- property ThreadHandle as Integer
- property Username as String
- 14 methods
- method Arguments as String()
- method CloseInput
- method CloseStreams
- method Constructor
- method Destructor
- method Execute(Executable as String)
- method ExitCode as Integer
- method Poll
- method ReadError as String
- method ReadOutput as String
- method SetArguments(arguments() as String)
- method Terminate(WinExitCode as Integer = 255) as boolean
- method Wait(TimeOut as double = 30.0)
- method WriteInput(data as string) as Integer
This class has no sub classes.
Some examples using this class:
Blog Entries
- MBS Xojo Plugins, version 25.0pr7
- MBS Xojo Plugins, version 23.5pr6
- News from the MBS Xojo Plugins in Version 23.0
- MBS Xojo Plugins, version 23.0pr8
- MBS Xojo Plugins, version 22.6pr1
- MonkeyBread Software Releases the MBS Xojo Plugins in version 21.2
- MBS Xojo Plugins, version 21.2pr6
- MBS Xojo Plugins, version 20.1pr1
- MBS Xojo Plugins, version 19.5pr1
- MBS Xojo Plugins in version 19.2
Xojo Developer Magazine
Videos
Release notes
- Version 25.0
- Added MergeErrorAndOutput property to ShellMBS class.
- Version 23.5
- Fixed Terminate in ShellMBS class for Windows to work better.
- Version 23.0
- Version 21.2
- Fixed ShellMBS and WindowsProcessMBS classes for Windows to allow PowerShell.exe to run.
- Version 20.1
- Fixed a bug in ShellMBS class when running applications on Windows with empty ApplicationName.
- Version 19.5
- Added ProcessHandle and ThreadHandle to ShellMBS and WindowsProcessMBS classes.
- Version 19.2
- Added ShellMBS class.
The items on this page are in the following plugins: MBS Util Plugin.
SharingPanelMBS - SignalHandlerMBS