Reminisce
Active Member
Hello everyone, I've searched the forum, but nothing comes close to what I want to achieve. I built a simple app on b4a, that uses socket and asynstreams to send commands to my b4j client. But jshell is not executing those commands.
B4X:
Sub astreams_NewData (Buffer() As Byte)
Dim receivecommand As String = BytesToString(Buffer,0,Buffer.Length,"UTF-8")
Select receivecommand
Case "SHUTDOWN"
Dim l As List
Log(receivecommand)
l.Initialize
l.Add("SYSTEMINFO")
shell.Initialize("shell","cmd.exe",l)
shell.WorkingDirectory = "C:\WINDOWS\system32\"
shell.Run(-1)
Wait For shell_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
Log(StdOut)
Log(Success)
End Select
End Sub
[\code ]
The above code receives the command, but doesn't execute it. I