#1
|
|||
|
|||
Calling on 3 text files for changing interface decscriptions
Hello All
I have a need to change about 400 interface descriptions on Cisco 3750 switches. I have a list of device names, interfaces and the correct descriptions. I want a script that will log into the first device on the list, then the interface and then the description. Is this posible? I already have a script that I use to log onto multiple devices and add config, but I dont fully understand it, just was I need to change each time to make it work. So I dont know how to modify it in this case. Here is was I use currently; Sub main Dim fso, fil, user, passwd, line, params Set fso = CreateObject("Scripting.FileSystemObject") Set fil = fso.OpenTextFile("C:\List.txt", ForReading, 1) Do While fil.AtEndofStream <> True line = fil.Readline ' params = Split(line, ",") crt.Session.Log False crt.Screen.Synchronous = True crt.screen.send "ssh" & " " & line & vbcr Dim nResult nResult = crt.Screen.WaitForString("?", 10) if nResult = 0 Then ' msgbox params(0) & " " & "Not Found" crt.screen.send chr(3) ' metname1 = params(0) ' port1 = params(1) ' strmetname1 = strmetname1 & metname1 & "," & params(1) & vbcrLf Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.CreateTextFile("C:\NoAccess.txt", ForWriting) objFile.Write objFile.Close Else crt.Screen.Send "yes" & chr(13) crt.Screen.WaitForString "password:" crt.Screen.Send "PASSWORD" & chr(13) crt.Screen.WaitForString "A:" More config....... end if crt.screen.send " logout" & vbcr crt.Screen.Synchronous = False crt.screen.waitforstring "mike.adams@adminjumphost1:~$" loop end Sub Any help would be much appreciated. Many thanks Mike |
#2
|
|||
|
|||
Hello Mike,
Could you clarify what you mean in the statements below? Quote:
The scripting manual that is available here on our website is the best resource for VBScript tips in regards to automating tasks in SecureCRT.
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | Rate This Thread |
|
|