I found out how to execute dos commands in C++ and get output in the console window. I connected to a telnet server but I couldn't call telnet commands by doing system(telnetcommand.c_str()); , is there a way to call telnet commands in C++?