B4J Question How to start an external programm on windows ?

GMan

Well-Known Member
Licensed User
Longtime User
How can i call and start an external program on a windows pc ?
Seems that the SHELL command is rigth, but this here dont work:

in Appstart
B4X:
    Dim shl As Shell
    shl.Initialize("shl", "java", _
     Array As String("mysoftware.exe"))
    shl.WorkingDirectory = "C:\Program Files (x86)\MySoftware\"
    shl.Run(10000)

additional sub

B4X:
Sub shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
    If Success And ExitCode = 0 Then
        Log("Success")
        Log(StdOut)
    Else
        Log("Error: " & StdErr)
    End If
    ExitApplication
End Sub
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

GMan

Well-Known Member
Licensed User
Longtime User
Sorry, forgot it:
Hauptklasse mysoftware.exe konnte nicht gefunden oder geladen werden

Is the code with the Working Dircetory with "\" correct ?
But also without it causes the same error
 
Upvote 0

GMan

Well-Known Member
Licensed User
Longtime User
Thx a lot (again) DonManfred - that does the trick :)
The mysoftware.exe is another JavaExecutable.will call one from the other for supporting each other

btw: have a look to your Moneypool :rolleyes:
 
Upvote 0
Top