When I open a command prompt manually and type the following command I get a response from the server I am pinging.
telnet <server> <port>
When I open the command prompt with Ruby, using the following command, and run the same telnet command above, I get ''telnet' is not recognized as an internal or external command, operable program or batch file.'
Ruby command:
system('start cmd.exe)
It opens the prompt fine, but the command itself is not working, and I am not sure to why that is.
Some good next steps are:
telnet.exe
using WHERE
, then invoke system
with the path to telnet.exe
.system
, I recommend using Open3.popen3()
so that you can interact with the actual telnet program via STDIN
, STDOUT
, and STDERR
.net-telnet
as it exposes an easier API to use versus wrapping the Windows Telnet client.