I have finally managed to start a console app and send parameters to it with the jShell library. My question is if it is possible to run the process in background, I mean without opening the DOS window?
Hi ,
"/c" Carries out the command specified by string and then terminates,
I use cmd a lot but i did not seen it popping up either might be too fast regardless of sh.run(1000)
Sorry I probably did not explain correctly what I want to do. I'm working on a B4J UI app that is connected to a microcontroller by UART. I have a bootloader on the MCU and I want to reprogram the MCU via the B4J app (and this is actually working). I'm using ds30Loader bootloader.
Here is how I start it:
B4X:
Sub RunShellCommand
'ds30LoaderConsole must be in objects folder!
Private shl As Shell
Private params As List
params.Initialize
params.Add("/c")
params.Add("start")
params.Add("ds30LoaderConsole.exe") 'located in File.DirApp
params.Add("-f="&fname) 'fname is the full path of the hex file. TODO change it for File.DirApp
params.Add("-d=pic16f1825") 'device
params.Add("-k=com14") 'COM Port
params.Add("-r=115200") 'Baudrate
params.Add("-p") 'write flash
params.Add("-o") 'non-interactive
shl.Initialize("shl","cmd.exe",params)
shl.WorkingDirectory = File.DirApp
Try
' Run with disabled timeout
shl.Run(-1)
Catch
Log(LastException.Message)
End Try
End Sub
I just want to hide the magic and do not show the DOS window. But I can live with it, ds30Loader is fully free and can be used or modified at will.