Automate TELNET commands using VB Script

TipsMake.com - The processing of batch work with .bat files (batch job) and recently using Windows scripts (.wsf) is the first choice of network administrators, to increase public performance The most optimal way. Using batch jobs you can automatically install and remove applications, inventory software or settings for the operating system of all computers on the network. However there are certain tasks that sometimes need to go through multiple authentication layers, such as TELNET .

Picture 1 of Automate TELNET commands using VB Script TELNET (short for TErminaL NETwork ) is a network protocol that is used on connections to the Internet or connections at the local LAN computer network. The purpose of the TELNET protocol is to provide a general, bipolar media, using 8-bit width, byte orientation.

Many network administrators use TELNET for switches to query or set up ports, monitor system operation status, even restart network devices from the command line via TELNET. Therefore it is much more convenient if you can automate TELNET jobs just like batch jobs.

In fact, if you are used to using VB scripts to create Windows scripts, VB script provides a very useful feature when you set up Windows Shell scripts for objects, then release that object carefully. by time by the command. Basically, this is like you're sitting in front of a command window and typing in it. The only difference is that the Windows script will send the command window to you.

Automate TELNET Job

Basically we have two parts to do for this task. You need to sequence the commands you want through the typical TELNET session.

In this example, we have 5 devices on the network that need to boot remotely via TELNET using 4 simple commands. The first is to use an IP address and a specific port. Next a menu appears, press Enter .

Picture 2 of Automate TELNET commands using VB Script

Select a number corresponding to the functions in MAIN MENU , press Enter .

Picture 3 of Automate TELNET commands using VB Script

Now we have different methods to do this. Some people like to use TST script . But it is somewhat complicated for an inexperienced person. TCL is also a similar scripting language, used for many years. However, here we will guide you to use a VB script file to perform tasks in the shortest, simplest time.

To do this, place the following code in a file, such as AutoTELNET.wsf, and then double-click to run:

First, set up TELNET:

That is the whole process of automating TELNET, with just three easy steps in an uncomplicated script. After getting used to it, you can customize them to your needs in automating tasks to manage network switches, time clocks or remote system control via TELNET.

ncG1vNJzZmismaXArq3KnmWcp51krrbAzqaYrZ1dqbKtusStZJynnaKur7DSZqysoZ6cereujKyaq6GgqQ%3D%3D