2

I have a windows 10 laptop (it's pretty old, but I don't think that should be a problem). I followed the instructions and went through control panel and enabled Telnet Client using an admin password. However, when I launched cmd and typed telnet, I received the error message "telnet could not be recognized as an internal or external command..." I also tried this with an admin-powered cmd and got the same error.

After a bit more of searching, I found a command that should enable telnet. I typed in "dism /online /Enable-Feature /FeatureName:TelnetClient" and it said something like installation complete. However, even after typing telnet into cmd, I got the same error message.

Edit: I located telnet.exe in the System32 folder and if I run it from file explorer directly it works fine. However, when I type in the path in cmd I am getting the same error message. And if I type "start path/telnet.exe" I also get the same error message.

Edit 2: I added system32 to the path variable, but typing "start path/telnet.exe" just gives the error message that it couldn't locate it.

Edit 3: it seems that cmd is not even recognizing the existence of telnet.exe. I followed Binarus' help and typed in dir c:\windows\system32\telnet.exe and am getting file not found. Anyone know what I can do?

3
  • What happens if you search for telnet.exe to know where it is located, and then try c:\path\to\telnet.exe?
    – Binarus
    Commented Sep 12, 2020 at 8:39
  • @Binarus I have added an edit regarding your comment Commented Sep 12, 2020 at 15:40
  • Have you tried closing all terminals and re-opening before executing telnet? The only way a terminal's %Path% can be updated in Windows is by closing and re-opening AFAIK since you can't source like in BSD/Linux
    – JW0914
    Commented Jun 1 at 14:03

3 Answers 3

0

Your edit proves that telnet itself works correctly. I suspect that your problem is caused by its parent directory not being in the path. If you don't know what that means, there are several starting points to learn about it, for example here.

To be honest, I wouldn't be that keen on starting telnet from the command line. Instead, you could easily create a shortcut to it (now that you have found it), place that shortcut on your desktop and start it by double-clicking the shortcut in the future.

However, if you insist on being able to start it from the command line, you have two options:

  1. At the command line, type the full path, i.e. type c:\windows\system32\telnet.exe instead of just telnet.

  2. Change your PATH environment variable. One way to do that would be via This PC -> Properties -> Advanced System Settings -> Advanced -> Environment Variables. Please note that there are system-wide environment variables as well as user-related ones. If you change the PATH variable system-wide, all users will have the pleasure of being able to open telnet the way you want; otherwise, only the respective user is affected. To test whether your changes worked, you can just type PATH in a command window; this will list all directories which are in the path for the current user.

9
  • I have tried the command: start "c:/windows/system32/telnet.exe" but that just returned another cmd window with the telnet icon and the title "c:/windows/system32/telnet.exe". However, it works just like cmd and any of the telnet commands don't work. I looked at the path variable in cmd and got a large list of directories including system32, but when I looked at it through the environmental settings there was only 1 directory. So I added system32 to there, but cmd still gives the same error message. Commented Sep 12, 2020 at 17:57
  • Also when I tried start c:/windows/system32/telnet.exe (without quotations around the path) I got the error message that it couldn't find the specified path. Commented Sep 12, 2020 at 17:59
  • Now I am running out of ideas. Could you please post the output when you type dir c:\Windows\system32\telnet.exe in the command window (please really use backslashes here instead of forward slashed as in your examples)?
    – Binarus
    Commented Sep 13, 2020 at 19:16
  • 1
    I get "Volume in drive C is Windows; Volume Serial Number is D6D2-C99E; Directory of c:\Windows\system32; File Not Found" The semicolons are supposed to represent line breaks because I can't add line breaks into a comment. This is really weird. I see it in my system32 folder, and I have tried the same command with some other files, and of the few I tried, only tellib.dll and telnet.exe returned "file not found". I even typed in "dir " and dragged the telnet icon into the command prompt window to copy the path, and I am still getting "File not found" Commented Sep 13, 2020 at 21:21
  • Same problem here. Telnet.exe is installed in system32 but unable to be started from the command-line. I can double-click it to start it. Note that the dir command in system32 also does not include telnet.exe in its list. telnet.exe only shows up in File Explorer.
    – xofz
    Commented Sep 13, 2020 at 22:35
0

I had this problem then realised that I was in the default C:\Users\Admin folder. Calling telnet from this folder does no good.

cd C:\windows\system32

BOOM! telnet worked a treat!!

3
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Apr 28, 2023 at 14:27
  • Not working!!!!!! Commented Nov 30, 2023 at 11:07
  • Anything within %WinDir% and %WinDir%\System32 can be executed from any terminal path as they're apart of the system-wide environment variable %Path% - see cmd /c echo %path%. Before a terminal can execute a new executable or script added to somewhere within %Path% | $Path, all terminal instances must be closed and re-opened since there is no way AFAIK to re-source %Path% | $Path from a terminal or while one is open
    – JW0914
    Commented Jun 1 at 15:44
-1

I had this problem running telnet from a MSVC 2019 C++ program using System("start telnet"). When I did System("start cmd") and a dir on c:\windows\system32 telnet.exe was not displayed. In fact large number of files and directories were missing. I solved this by copying telnet.exe to a different directory. This worked for me because I am only using it to run a canned batch file. The telnet prompts are not displayed running in manual mode.

1
  • This isn't recommended for two reasons: (1) it prevents telnet.exe from being updated; (2) Upon running Sfc /ScanNow, telnet.exe will again be installed back to %WinDir%\System32 because %WinDir% is now corrupted after removing a system file. There are only a couple locations within %WinDir% that contain user modifiable files, such as files within .\System32\driver\etc, everything else is never to be touched because they're system files not meant to be modified, that upon modifying corrupts %WinDir%; when that corruption is fixed by Sfc, it undoes all modifications
    – JW0914
    Commented Jun 1 at 14:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .