Vswitch telnet Automatic Logon command details

Source: Internet
Author: User

In our past studies, we have provided some basic introductions to telnet, but I don't know if you have mastered it. You can set Automatic Logon for the telnet service, switch telnet automatic logon, or batch processing settings. Now let's explain how to set up Automatic Logon Through telnet on the H3C switch. Now let's take a look at the specific command code.

@ Echo off & SETLOCAL ENABLEDELAYEDEXPANSION
Color 7d
Echo lab network management
Echo 1: Disable Internet 2: open Internet
Input 1 or 2 for echo operation.
Set/p v = [enter 1/2]
Echo.

If/I "% v %" = "1" goto: close
If/I "% v %" = "2" goto: open
Goto: exit
: Open
Echo set sh = WScript. CreateObject ("WScript. Shell")> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "telnet10.20.000016"> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "{ENTER}"> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "****** {ENTER}"> telnet_tmp.vbs; ***** Password
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "sys {ENTER}"> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "interface gigabitethernet */* {ENTER}"> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "port trunk permit vlan *** {ENTER}"> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "quit {ENTER}"> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "quit {ENTER}"> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "quit {ENTER}"> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "quit {ENTER}"> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "{ENTER}"> telnet_tmp.vbs
Echo WScript. Sleep 500> telnet_tmp.vbs
Echo sh. SendKeys "del telnet_tmp.vbs {ENTER}"> telnet_tmp.vbs
Start cmd
Cscript // nologo telnet_tmp.vbs
Goto: exit
: Close
Echo set sh = WScript. CreateObject ("WScript. Shell")> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "telnet10.20.000016"> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "{ENTER}"> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "****** {ENTER}"> telnet_tmp.vbs; ***** Password
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "sys {ENTER}"> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "interface gigabitethernet */* {ENTER}"> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "undo port trunk permit vlan *** {ENTER}"> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "quit {ENTER}"> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "quit {ENTER}"> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "quit {ENTER}"> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "quit {ENTER}"> telnet_tmp.vbs
Echo WScript. Sleep 300> telnet_tmp.vbs
Echo sh. SendKeys "{ENTER}"> telnet_tmp.vbs
Echo WScript. Sleep 500> telnet_tmp.vbs
Echo sh. SendKeys "del telnet_tmp.vbs {ENTER}"> telnet_tmp.vbs
Start cmd
Cscript // nologo telnet_tmp.vbs
: Exit
Exit

The preceding command code is used to automatically log on to the H3C switch via telnet. I hope this article will help you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.