B4J Question With shell Exceute process into foreground

jinyistudio

Well-Known Member
Licensed User
Longtime User
Hi,

I use processExecute to lunch a non-ui application but it always run in background.
Could i let it run in the foreground ?

B4X:
Sub ProcessExecute(ExeName As String) As Boolean   
    Dim shl As Shell
    shl.Initialize("shl",ExeName,Null)
    shl.WorkingDirectory = File.DirApp
    shl.RunWithOutputEvents(-1)   
End Sub
 

jinyistudio

Well-Known Member
Licensed User
Longtime User
Hi
Yes,I want to run as a shell window.
My new code as following but it always running into backgroud. :(:(:(
My ExeName isn't a jar. it is exe transfer from launch4j.

B4X:
Sub ProcessExecute(ExeName As String) As Boolean  
    Dim shl As Shell
    Dim params As List: params.Initialize
    params.Add(" /k ")
    params.Add(ExeName)  
    shl.Initialize("shl","cmd",params)
    shl.WorkingDirectory = File.DirApp
    shl.Run(-1)     
End Sub
 
Upvote 0

jinyistudio

Well-Known Member
Licensed User
Longtime User
Hi

cmd /c start It's OK :)
 
Upvote 0
Top