B4J Question kill execute file created by launch4j

jinyistudio

Well-Known Member
Licensed User
Longtime User
Hi

My b4j application transfer to .exe by lanuch4j. its java.exe doesn't killed together when i kill the exe. How could i kill them together ? I have try to use jps.exe but i don't see anything ?
 

jinyistudio

Well-Known Member
Licensed User
Longtime User
1. yes,non-ui
2. I use following code could kill process(make with lunch4j) but its java.exe couldn't kill together.

B4X:
Sub ProcessKill(ExeName As String) As Boolean
    Dim Result As ShellSyncResult
    Dim sh As Shell
    sh.InitializeDoNotHandleQuotes("", "taskkill", Array As String("/IM", ExeName,"/F"))
    Result = sh.RunSynchronous(2000)
    Return Result.StdOut.Contains($"${ExeName}"$) And Result.StdOut.Contains("(PID ")
End Sub
 
Last edited:
Upvote 0
Top