B4J Question Run External Exe File

BarryW

Active Member
Licensed User
Longtime User
Hi. How to call external exe file. i know that it uses jshell. Any working sample tnx.
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
something like this?

B4X:
public sub shTest
            Dim sh As Shell
            Dim pathToExe As String = File.Combine(File.DirApp,"yourExe.exe")
            sh.Initialize("test",pathToExe,Null)
            sh.RunSynchronous(-1)
end sub

public Sub test_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
   log(Success)
End Sub
 
Upvote 0

GDO

Member
Licensed User
Longtime User

Hi

B4X:
           sh.Initialize("test",pathToExe,Null)
           sh.RunSynchronous(-1)

Is working for me too.
Even with a list of arguments in place of Null.
But when one argument is a path it's only working with shortname path or file, not with longname (especially with blank inside).

Do you know a way to get the shortname from a longname ?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…