Log on to the cisco switch and run the command

Source: Internet
Author: User
Tags cisco switch


Batch Processing directly logs on to the cisco switch and executes commands. In many cases, we may log on to the cisco switch to execute some common viewing commands. However, every time we run cmd, enter the password, and enter the command, it is troublesome. It can be achieved through batch processing. For example, if you log on to the cisco switch 192.168.0.1 and ping another switch 192.168.0.2 www.2cto.com, the script is as follows: @ echo offecho set sh = WScript. createObject ("WScript. shell ")> telnet_tmp.vbsecho WScript. sleep 300> telnet_tmp.vbsecho sh. sendKeys "open 192.168.0.1"> telnet_tmp.vbsecho WScript. sleep 300> telnet_tmp.vbsecho sh. sendKeys "{ENTER}"> telnet_tmp.vbsecho WScript. sleep 300> telnet_tmp.vbsecho sh. sendKeys "root {ENTER }" > Telnet_tmp.vbsecho WScript. sleep 300> telnet_tmp.vbsecho sh. sendKeys "YOUR_PASSWORD {ENTER}"> telnet_tmp.vbsecho sh. sendKeys "ping 192.168.0.2 {ENTER}"> telnet_tmp.vbsstart telnet cscript // nologo telnet_tmp.vbsecho del telnet_tmp.vbs www.2cto.com so that ping results can be immediately displayed. However, sometimes we want users to perform some tests and directly send the execution results to us in text format. This requires redirecting the debugging results to text files.

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.