Can I abort telnet while it is still trying to connect? - Super User most recent 30 from superuser.com2010-03-21T09:56:54Zhttp://superuser.com/feeds/question/70485http://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://superuser.com/questions/70485/can-i-abort-telnet-while-it-is-still-trying-to-connect0Can I abort telnet while it is still trying to connect?René Nyffeneggerhttp://superuser.com/users/166102009-11-14T10:34:04Z2009-11-14T12:40:20Z
<p>At times I find myself telnetting from Windows XP to another server and that I state a wrong port number such as</p>
<pre><code>c:\> telnet xxxxx.yy pp
</code></pre>
<p>After hitting Enter, I realize that I entered the wrong port number and would like to abort the telnet process with a ctrl-c, however, telnet doesn't seem to respond even to ctrl-c. So, I have to wait a few seconds until telnet returns with a </p>
<pre>Connecting to xxxxx.yy...
Could not open connection to the host, on port pp: Connect failed</pre>
<p>It's rather annoying to wait for the error message, especially when I already know it will eventually come.</p>
<p>So, is there a way to immediately stop the telnet process?</p>
http://superuser.com/questions/70485/can-i-abort-telnet-while-it-is-still-trying-to-connect/70486#704863Answer by ~quack for Can I abort telnet while it is still trying to connect?~quackhttp://superuser.com/users/127862009-11-14T10:43:03Z2009-11-14T12:04:33Z<p><strong>Edit</strong>: Of course, it's never that simple. As you've observed, Microsoft's telnet doesn't respond to <code>^]</code> while waiting for a connection.</p>
<p>If you don't want to wait around, you only have two options:</p>
<ul>
<li><p>Kill the telnet process (from another command shell or the task manager), or</p></li>
<li><p>Use another telnet client. <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" rel="nofollow">PuTTY</a> is a good choice, since it will launch as a separate window; even if you get the port wrong and the PuTTY window freezes, your command shell will be available to launch another instance with the correct port number.</p></li>
</ul>
<p><hr></p>
<p>Use the escape character (defaults to <code>Ctrl+]</code>). This brings up a telnet prompt at which you can close or quit the connection.</p>
<pre><code>> telnet
Welcome to Microsoft Telnet Client
Escape Character is 'CTRL+]'
Microsoft Telnet>
</code></pre>
<p>You can change this to nearly anything you like on your commandline by using the <code>-e</code> flag:</p>
<pre><code>C:\>telnet /?
telnet [-a][-e escape char][-f log file][-l user][-t term][host [port]]
[...]
-e Escape character to enter telnet client prompt.
[...]
C:\>telnet -e '
Welcome to Microsoft Telnet Client
Escape Character is '''
Microsoft Telnet>
</code></pre>