How to Write Telnet Output to File

by Ken White

The telnet protocol, developed in 1973, is a terminal service used to connect to a remote computer over a network. It has been replaced for the most part by SSH, an encrypted protocol for security, although Microsoft still includes the telnet command-line client with Windows. The telnet client lets you set the terminal type you're emulating, turn local echo on or off to display what you type to the screen, and log your session to a text file on your computer for later review.

1

Press and hold the "Windows" key on your keyboard and press "R" to open a Run box. Type "cmd" (without quotes) in the "Open" text field, then press "Enter" or click "OK."

2

Type "telnet" at the command line.

3

Type "set logfile filename" where "filename" is the name of the file you will use to log the telnet session. For example, if you want to save your log to a text file called "website.txt," type "set logfile website.txt" and press "Enter."

4

Type "open hostip port" where "hostip" is the IP address of the computer to which you are connecting and "port" is the port number for the connection. For example, type "open 192.168.1.1 80" to open a connection with the server at 192.168.1.1 on port 80. The output of your telnet session is saved to the text file you specified.

Tips

  • If you do not enter a port number when you connect to a server with telnet, the program uses the default telnet port 23.
  • You can download free telnet clients like Putty or Poderosa that provide a graphic user interface for your telnet sessions.

Warning

  • Telnet is not automatically available with a default installation of Windows 7. To turn on the telnet client, go to the Control Panel, click "Programs" and then click "Turn Windows Features On or Off." Click the "Telnet Client" check box and click "OK."

About the Author

Ken White began his writing career in 1972 as a reporter for a local Florida newspaper. With a career in public safety as a police officer, firefighter and emergency manager, his fiction has also been published in magazines such as "Alfred Hitchcock's Mystery Magazine." White studied history and psychology at Mercer University.

More Articles