Turn on the Telnet client in Windows: "telnet is not recognized"
Windows ships without the Telnet client installed. Turn it on with DISM or PowerShell, then use telnet host port, the escape prompt and quit.
You type telnet in Command Prompt or PowerShell and Windows answers that it is not recognized as a command. The command is not missing from Windows. The Telnet Client is an optional feature, and Microsoft's documentation says you must install it before telnet will run.
Turn it on from the command line
Open Command Prompt or PowerShell as administrator and run one of these. Both turn on the same feature, called TelnetClient:
dism /online /Enable-Feature /FeatureName:TelnetClient
Enable-WindowsOptionalFeature -Online -FeatureName TelnetClient
To check the state first, or afterwards:
dism /online /Get-FeatureInfo /FeatureName:TelnetClient
On Windows Server, the Server Manager cmdlet uses a different name for the same thing:
Install-WindowsFeature -Name Telnet-Client
Open a new Command Prompt window when it finishes, so the new command is found.
You can also tick Telnet Client in the Windows Features dialog (run optionalfeatures). On a work PC, the administrator can hide that dialog with group policy. If the command line refuses too, ask them.
Using it
telnet host.example.com
telnet host.example.com 2323
With no port, Windows Telnet uses TCP port 23. Some options that help:
/t vt100(orvt52,ansi,vtnt) sets the terminal type it reports./f telnetlog.txtwrites the session to a log file./l namesends a user name for automatic logon, where the server supports it.
Run telnet with no host to get the Microsoft Telnet> prompt. There, o host port opens a connection and q quits. During a session, the escape character brings you back to that prompt; /e changes which key it is.
When Telnet is not the right tool
- Testing whether a port is open. PowerShell's
Test-NetConnectiondoes this without installing anything. See Check if a TCP port is open without Telnet: nc, Test-NetConnection, bash. - Mainframe and IBM i hosts. Windows Telnet is a VT-style client. It cannot show 3270 or 5250 screens. See Can PuTTY or Windows Telnet connect to a mainframe or IBM i?.
- Logging in to a Unix or Linux server. Use SSH. Microsoft's OpenSSH for Windows guide shows how to check for the
sshclient and add it if it is missing.
Related
- Telnet basics
- Telnet "Connection closed by foreign host"
- Telnet to port 22: what the SSH-2.0 banner means
- Check if a TCP port is open without Telnet: nc, Test-NetConnection, bash
Sources
- telnet command, Microsoft Learn
- telnet: open, Microsoft Learn
- telnet: quit, Microsoft Learn
- Installing roles and features in different ways (TelnetClient, Telnet-Client), Microsoft Learn TechNet archive
- Add, remove, or hide Windows features, Microsoft Learn
- Get started with OpenSSH for Windows, Microsoft Learn