how to get result from exe file using java

hello

i have problem getting result from exe file using java

i have exe file (inducer.exe)
when i open in command line it i have to put two inputs
function name
file name

i had make bat file which work OK until opening the program
bat file contain
inducer.exe //OK with this it open the exe program
function name//after opening the program it does not write the function name
file name//also dose not write file name

the bat file work well until opening the exe program

is there any way to make bat file write the exe program parameters
or can i write that parameters using java and get result

thanks

I would thing that if you want to do this with java the best way would be to create a Process using the ProcessBuilder class. If you need to interact with the program after it starts you should then use a StreamReader and StreamWriter to interact with each of the objects returned by getErrorStream(), getInputStream() and getOutputStream() from your Process.