How to Send Telnet Commands in Visual Basic

Written by jim campbell
  • Share
  • Tweet
  • Share
  • Email

The Telnet ActiveX control lets you send commands to a Telnet server from a Visual Basic application. The control connects to the server and sends commands with the proper syntax. Telnet servers are older command-line applications that let administrators control server files and configurations.

Skill level:


  1. 1

    Click the Windows "Start" button and select "All Programs." Click "Microsoft .NET Framework," then click "Visual Studio" to open the Visual Basic programming platform.

  2. 2

    Click the Visual Basic project name in the list of "Recent Projects" to open the project files. After the project files load, right-click the form that you want to use in "Solution Explorer." Click "View Code" to open the Visual Basic code editor.

  3. 3

    Connect to the Telnet server. The following code shows you how to connect to the Telnet server and send the server your username and password to log in:

    Telnet1.Connect "server"

    Telnet1.Send "username" & vbCrLf

    Telnet1.Send "pass" & vbCrLf

    Replace "server" with the server name of your Telnet server. Replace "username" and "pass" with your own Telnet username and password.

  4. 4

    Send commands to the server. For instance, if you want to run the application named "ReportApp," type the following code in the Visual Basic editor:

    Telnet1.Send "ReportApp" & vbCrLf

    Continue using the "Send" function to send commands to the server.

  5. 5

    Close the server connection. After you finish sending commands, add the following final Visual Basic code to close the connection:


Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.