Suppose i execute a command in java using the exec() function and i store the reference in a Process . How do i write into the input stream of that process
Process P = Runtime.getRuntime().exec("cmd /c start telnet");
System.out.println("done running ..");
OutputStream output = P.getOutputStream();
BufferedOutputStream out = new BufferedOutputStream(output);
String S = "open\n";
byte[] BS = S.getBytes();
out.write(BS); out.close();
I had done that but its not workin.......... above is my code attached