0

Hi,

I want to check whether a system exists in LAN or not and also the database residing in that system is up or not.So, for this I'm trying to use telnet command as follows,

Runtime rt=Runtime.getRuntime();
Process p=rt.exec("telnet 192.168.1.15");

No error nothing ,It is executing .But by using the above command I don't know how to retrieve the success status .

Please,tell me a solution for this or is there any other way to solve this problem .

Thanks,
Sirisha.

3
Contributors
2
Replies
4
Views
9 Years
Discussion Span
Last Post by Rushikesh27
0

I think you will need to use the getInputStream() and getOutputStream() methods in the Process class to be able to do what you want to do. Basically you can use the I/O streams to communicate with the Process and then you can use the output from the Process to work out whether your command is successful. This might require a bit of trial and error, so I'll leave you to have a go at it.

0

We have develop a telnet client and remote server we are facing a problem with telnet command how to execute telnet comand in windows....

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.