B4J Question Call external program from B4J

dk9uv

Member
Licensed User
Longtime User
Hi,

is it possible to call an external program (any kind of .exe with or without command line parameters) from B4J?

Runtime.exec or ProcessBuilder might be candidates?


Thanks for your comments
 

desof

Well-Known Member
Licensed User
Longtime User
Hi I am using the library to call JShell eternal exe and works fine if I just put the path directly from the variable no

I think I explain the code correctly

B4X:
Sub btEjec_Action
Dim js As Shell
Dim params As List: params.Initialize
Dim FileRun As String

params.Add(File.DirApp)

FileRun=File.DirApp &"\Proyecto1.exe"
Log(FileRun) =>>>  'C:\Documents and Settings\xxxxx\Mis documentos\Proyecto1.exe

'js.Initialize("js",FileRun, params) 'NO RUN
js.Initialize("js","C:\Documents and Settings\XXXXX\Mis documentos\Proyecto1.exe", params)' YES RUN
js.WorkingDirectory = File.DirApp
js.Run(-1)
End Sub
 
Upvote 0
Top