How to execute batch script which takes multiple inputs by using Java Process Builder?
I have a batch script which takes input as user name and age and prints both the inputs. I want to write a java program to execute that script and pass the inputs. I have written the java program using ProcessBuilder. I am also passing the username and age in the process OutputStream but only user name is getting printed and age is missing. my script(test.bat file) : @echo off echo executing test.bat set /p name=Enter Name: set /p age=Enter Age : echo Hi %name%, you are %age% years old. my java program : private static void executeInteractiveCommand(String cmd,String ... args){ try{ List