導(dǎo)讀:在以往的學(xué)習(xí)中,我們對telnet的一些基本介紹,不知道大家是否已經(jīng)掌握了。telnet服務(wù)可以設(shè)置自動登錄,也可以進(jìn)行交換機telnet自動登錄或者是批處理的有關(guān)設(shè)置,F(xiàn)在我們來講解一下H3C交換機telnet自動登錄的設(shè)置,F(xiàn)在我們就來看一下具體的命令代碼吧。
@echo off&SETLOCAL ENABLEDELAYEDEXPANSION
color 7d
echo 實驗室網(wǎng)絡(luò)管理
echo 1:關(guān)閉外網(wǎng) 2:打開外網(wǎng)
echo 請輸入 1 或 2 進(jìn)行操作
set/p v=[輸入 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.20.16" >>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 ;*****密碼
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.20.16" >>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 ;*****密碼
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
以上就是H3C交換機telnet自動登錄的命令代碼了。希望本文能夠?qū)Υ蠹矣兴鶐椭?/P>
北京 | 天津 | 上海 | 江蘇 | 山東 |
安徽 | 浙江 | 江西 | 福建 | 深圳 |
廣東 | 河北 | 湖南 | 廣西 | 河南 |
海南 | 湖北 | 四川 | 重慶 | 云南 |
貴州 | 西藏 | 新疆 | 陜西 | 山西 |
寧夏 | 甘肅 | 青海 | 遼寧 | 吉林 |
黑龍江 | 內(nèi)蒙古 |