# How to run and read the results of command prompt/telnet from a processing sketch?

**URL:** <https://discourse.processing.org/t/how-to-run-and-read-the-results-of-command-prompt-telnet-from-a-processing-sketch/11571>\
**Category:** Coding Questions\
**Created:** [May 25, 2019, 1:16am UTC](https://discourse.processing.org/t/how-to-run-and-read-the-results-of-command-prompt-telnet-from-a-processing-sketch/11571 "2019-05-25T01:16:18Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Birb](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/birb/32/3280_2.png) [@Birb](https://discourse.processing.org/u/Birb)\
**Post date:** [May 26, 2019, 10:31pm UTC](https://discourse.processing.org/t/how-to-run-and-read-the-results-of-command-prompt-telnet-from-a-processing-sketch/11571/6 "2019-05-26T22:31:14Z")

</div>

I posted my attempt with sockets here, although I wasn’t able to get a connection to the server (in this case Google’s MX server on port 25).

> [@TCP mail client session in Processing not working](https://discourse.processing.org/t/tcp-mail-client-session-in-processing-not-working/11618):
>
> I’m trying to open a TCP socket with a mail server and then send/read commands, but it isn’t working. After running for several minutes with no response I get the IOException catch error “Couldn’t get I/O for the connection to: hostname”. import java.io.\*; import java.net.\*; void setup() { size(200,200); Socket smtpSocket = null; DataOutputStream os = null; // DataInputStream is = null; BufferedReader br = null; try { smtpSocket = new Socket("64.233.177.26", 25); os = new…

I may have to look into executing telnet commands with a bat script, but I wish I could do it from within a processing sketch if possible.

---

_[View the full topic](https://discourse.processing.org/t/how-to-run-and-read-the-results-of-command-prompt-telnet-from-a-processing-sketch/11571)._
