自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

telnet批處理的設(shè)計(jì)

網(wǎng)絡(luò) 網(wǎng)絡(luò)管理
telnet批處理可以讓我們的工作高效快捷。那么這個腳本的設(shè)計(jì)我們在文中為大家詳細(xì)介紹一下。希望這些代碼能夠幫助大家完成工作。

由于工作需要,處理上百個機(jī)器也是常見的事情。這里我們主要介紹一下創(chuàng)建一個telnet批處理程序來幫助完成工作,那么這里我們?yōu)榇蠹页尸F(xiàn)了具體的代碼。希望對大家有所幫助。首先做了一個批處理文件,iplist.bat,讓它具備了采交換機(jī)IP和調(diào)用VBS腳本的功能,代碼如下:

  1. for /l %%a in (1,1,254) do ping 192.168.20.%%a -n 1 -l 16 -w 100 | find "eply" &echo 192.168.20.%%a >>iplist.txt & echo off   
  2. (注:這個不成功,返回的1-254的IP,需修改)  
  3. rem 啟動telnet  
  4. start telnet.exe  
  5. rem batch telnet  
  6. cscript //nologo tftp.vbs 

這一步telnet批處理的設(shè)置,編輯了修改交換機(jī)時間的腳本,代碼如下:

  1. 'This Script is For copy config file to tftp server  
  2. 'This script is named "tftp.vbs"  
  3. On Error Resume Next  
  4. dim fSwitchList,objTextStream,objFSO,objSwitch  
  5. fSwitchList = "Iplist.txt" 
  6. Set objFSO = CreateObject("Scripting.FileSystemObject")  
  7. If objFSO.FileExists(fSwitchList) Then  
  8. Set objTextStream = objFSO.OpenTextFile(fSwitchList, 1)  
  9. Else  
  10. Wscript.Echo "Input file " & fSwitchList & " not found."  
  11. Wscript.Quit  
  12. End If  
  13. Do Until objTextStream.AtEndOfStream  
  14. objSwitch = objTextStream.ReadLine  
  15. set sh=WScript.CreateObject("WScript.Shell")  
  16. WScript.Sleep 1000  
  17. shshtelnet = sh.object  
  18. sh.SendKeys "  open " & objSwitch  
  19. WScript.Sleep 1000  
  20. sh.SendKeys "{ENTER}"  
  21. WScript.Sleep 1000  
  22. sh.SendKeys "enable pass{ENTER}"  
  23. WScript.Sleep 1000  
  24. sh.SendKeys "en{ENTER}"  
  25. WScript.Sleep 1000  
  26. sh.SendKeys "secret  pass{ENTER}"  
  27. WScript.Sleep 1000  
  28. sh.SendKeys "conf t{ENTER}"  
  29. WScript.Sleep 1000  
  30. sh.SendKeys "ntp server 10.128.16.254{ENTER}"  
  31. sh.SendKeys "ntp source vlan 2{ENTER}"  
  32. sh.SendKeys "clock timezone CCT 8{ENTER}"  
  33. sh.SendKeys "end{ENTER}"  
  34. sh.SendKeys "wr{ENTER}"  
  35. WScript.Sleep 5000  
  36. sh.SendKeys " exit{ENTER}"  
  37. sh.SendKeys "{ENTER}"  
  38. Loop  
  39. sh.SendKeys " quit{ENTER}"  
  40. objTextStream.Close  
  41. Wscript.quit 

到這里我們就完成了telnet批處理的腳本設(shè)置了。

責(zé)任編輯:佟健 來源: csdn.net
相關(guān)推薦

2010-07-16 11:10:50

telnet批處理TCLEXPECT腳本

2010-07-16 11:23:06

Telnet客戶端

2010-07-27 15:39:32

telnet smtp

2010-11-19 15:25:48

關(guān)閉Oracle服務(wù)

2018-02-27 14:22:38

ETLKakfa數(shù)據(jù)集

2010-09-07 10:26:37

SQL語句

2010-07-20 13:29:30

Telnet服務(wù)器

2013-02-22 14:35:38

2024-08-14 08:11:41

2020-12-11 11:26:47

Spring批處理重試

2016-11-15 09:44:21

大數(shù)據(jù)批處理流處理

2010-04-12 14:33:43

Oracle備份恢復(fù)

2009-10-28 10:15:51

殺毒軟件病毒批處理

2010-03-01 14:02:26

Python批處理語言

2021-12-24 11:25:37

FreeDOS批處理文件Linux

2009-06-12 08:43:37

微軟Windows 7操作系統(tǒng)

2022-08-02 20:47:38

Spring框架應(yīng)用程序

2009-10-29 11:18:47

ADO.NET SQL

2013-12-09 10:06:50

Java批處理Java

2010-08-27 14:54:21

DB2批處理腳本
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號