Hello.
I try to run an exe file using jShell.
The following simple code is used:
then I have
When executed, I get the following error:
If from Windows command prompt I enter the command:
the application is executed.
What I'm doing wrong?
Thank you.
I try to run an exe file using jShell.
The following simple code is used:
B4X:
Dim sh1 as Shell
sh1.Initialize("sh1","myapp.exe",Array As String("-d","1","-p","5174"))
sh1.WorkingDirectory = "C:\MyApp"
sh1.RunWithOutputEvents(-1)
B4X:
Sub sh1_ProcessCompleted(Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
Log(StdOut)
Log("Error: " & StdErr)
End Sub
When executed, I get the following error:
B4X:
Error: org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "myapp.exe" (in directory "C:\MyApp"): CreateProcess error=2, The system cannot find the file specified)
If from Windows command prompt I enter the command:
B4X:
C:\MyApp\myapp.exe -d 1 -p 5174
What I'm doing wrong?
Thank you.