-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckcisco.vbs
56 lines (40 loc) · 1.28 KB
/
checkcisco.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# $language = "VBScript"
# $interface = "1.0"
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
crt.Screen.Synchronous =True
Sub main
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("C:\Users\user\Desktop\error.txt", ForReading, 0)
Set fso1 = CreateObject("Scripting.FileSystemObject")
strUsername2 = "noc"
strPassword2 = "noconly"
strexit = "quit"
strconshowcisco = "terminal length 0"
strconcisco = "show run"
Dim line, params
Do While f.AtEndOfStream <> True
line = f.Readline
params = Split( line , vbCrLf)
lineNb = UBound(params)
For i= 0 To lineNb
crt.Screen.WaitForString "PE-RIT02#"
crt.Screen.Send params(i) & Chr(10)
crt.Screen.WaitForString ("Username:")
crt.Screen.Send strUsername2 & Chr(10)
crt.Screen.WaitForString "Password"
crt.Screen.Send strPassword2 & Chr(10)
crt.Screen.WaitForString "PWA-"
crt.Screen.Send strconshowcisco & Chr(10)
crt.Screen.WaitForString "PWA-"
crt.Screen.Send strconcisco & Chr(10)
crt.Screen.WaitForString "PWA-"
crt.Screen.Send strexit & Chr(10)
crt.Screen.WaitForString "PE-RIT02#"
crt.Screen.Send vbCrLf
Next
Loop
'msgbox "!!!Node Ready : " & lineNb & " node!!!"
End Sub