#include ONCE "window9.bi"

Function RunProgram(sFilename As String, sParameter As String = "", sWorkingDirectory As String = "", sFlags As String = "", ShowCmd As integer = 0) as Integer Export
	
	dim as string sWD , sPr 
	
	if sWorkingDirectory <> "" then
	
		sWD = "cd " & sWorkingDirectory & "&&"

	EndIf
		
	if sParameter <> "" then
	
		sPr = " " & chr(34) & sParameter & chr(34)

	EndIf	
		
	shell (sWD & chr(34) & sFilename & chr(34) & sPr & " &") 
	
	Return 0
		
End Function