Can I abort telnet while it is still trying to connect?

Solution 1:

Edit: Of course, it's never that simple. As you've observed, Microsoft's telnet doesn't respond to ^] while waiting for a connection.

If you don't want to wait around, you only have two options:

  • Kill the telnet process (from another command shell or the task manager), or

  • Use another telnet client. PuTTY 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.


Use the escape character (defaults to Ctrl+]). This brings up a telnet prompt at which you can close or quit the connection.

> telnet

Welcome to Microsoft Telnet Client

Escape Character is 'CTRL+]'

Microsoft Telnet> 

You can change this to nearly anything you like on your commandline by using the -e flag:

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>