Telnet is not recognized as an internal or external command, operable program, or batch file

Problem Description

Telnet is a useful utility to check if a server port is listening, and thus, if a server has started correctly. By default, Windows does not install the telnet.exe program.

 

Open a command window and enter telnet; if telnet is installed, you will get a prompt that looks something like this:

Welcome to Microsoft Telnet Client
Escape Character is 'CTRL+]'
Microsoft Telnet>

To exit this telnet prompt, just type quit.

 

If telnet is not installed, you will get the following error message:

telnet is not recognized as an internal or external command, operable program or batch file.

 

Solution

To install the telnet executable:

  1. Hold down the ⊞ Win and S (Search) keys.
  2. Enter Add or Remove Programs and click the System settings option.
  3. In the Apps & features dialog, scroll down to Related settings and click Programs and Features.
  4. Click Turn Windows features on or off.
  5. Scroll down and select the Telnet Client check box.
  6. Click OK.
  7. Open a new CMD window and type telnet to see if it is installed. You should see a Microsoft Telnet> prompt.
  8. To quit, enter quit.

Examples

To see if Talend Administration Center (TAC) is running on your local machine on port 8080, type:

C:\Users\jsmith> telnet localhost 8080

 

or to see if TAC is running on a machine called mytac.mycorp.com on port 9090:

C:\Users\jsmith> telnet mytac.mycorp.com 9090

 

or to see if the MySQL server is running on a machine called mysql.mycorp.com on its default port, 3306:

C:\Users\jsmith> telnet mysql.mycorp.com 3306

 

If each of these servers is running, you should get a blank/black screen.

 

You can exit quickly by holding down the CTRL+D (end input) keyboard combination. If this does not work, you may need to quit/close the entire CMD window.

 

If you attempt to connect to a server and port where a server is not listening, you will get some type of Connect failed message, and end up back at the command prompt:

C:\Users\jsmith> telnet localhost 9393
Connecting to localhost...Could not open connection to the host, on port 9393: Connect failed
C:\Users\jsmith>

 

Alternatives to Telnet

The curl and wget commands can also perform a similar test if you have these installed.

 

The -I switch for curl says to only print the response headers, not the full text of the page:

C:\Users\jsmith>curl -I "http://localhost:8080"
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 19 Apr 2018 23:03:14 GMT

 

If your server is not started properly, you will get an error message, for example:

C:\Users\jsmith>curl -I "http://localhost:8080"
curl: (7) Failed to connect to localhost port 8080: Connection refused

 

The wget command does not have as much normal output, so you do not need switches:

C:\Users\jsmith>wget "http://localhost:8080"
--15:59:56--  http://localhost:8080/
           => `index.html.17'
Resolving localhost... done.
Connecting to localhost[127.0.0.1]:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

    [ <=>                                 ] 11,432        10.90M/s

15:59:56 (10.90 MB/s) - `index.html.17' saved [11432]

 

Of course, the full URL of your TAC will be something like:

http://your-tac-server.acme.com:8080/org.talend.administrator/

 

or, if you like to use a shorter name for your TAC:

http://your-tac-server.acme.com:8080/tac641/
Version history
Revision #:
19 of 19
Last update:
‎06-05-2018 02:53 AM
Updated by: