Calling an OS (Shell) command

BlitzMax Forums/BlitzMax Programming/Calling an OS (Shell) command

This should be considered unofficial, but there is a command in pub/stdc.mod called system_ which does work on Windows, and probably on the other OSes too (can't check right now):

system_ "notepad.exe"


Should be easy enough to replace if Mark decides to add an official command of this nature. Something like the below would be even easier to replace, given that an official command may have separate executable path, parameters, launch flags, etc...

' Quotes added automatically...

Function RunProgram (exe$, param$)
	Return system_ ("~q" + exe$ + "~q" + " " + "~q" + param$ + "~q")
End Function

' Assuming BlitzMax is in "C:\Program Files" here...

RunProgram "notepad.exe", "C:\Program Files\BlitzMax\versions.html"