scProcess = Runtime.getRuntime().exec( "Telnet 147.27.23.1");
807591May 7 2008 — edited May 7 2008Hello All,
I am trying to run telnet process from windows platform as follows
scProcess = Runtime.+getRuntime+().exec( "telnet 147.27.23.1");
Objective:*
My intention is to create a telnet connection to remote server, get the Input, Output and Error Stream of the process and run many unix commands on the session opened.
This all I want to do through code itself and then get the output of the command from streams.
Tried:*
However whenever I tried above, I always get process Exit value = -1.
I tried doing
scProcess = Runtime.+getRuntime+().exec( "cmd /c telnet 147.27.23.1");
which is also failing.
And
scProcess = Runtime.+getRuntime+().exec( "cmd /c start telnet 147.27.23.1"); which actually opens interactive telnet window, which is not my objective is.
Any suggestions on my objective? Is there any other way to do telnet from code?
Thanks in advance.
With Best Regards,
Aditya.