cpatte7372
asked on
VBS Script to Stop Logging
Hi All,
The following script starts logging before it goes through the actual body of the script. Can someone tweak the script so that it stops logging after it goes through script?
Sorry for the poor explanation
Cheers
The following script starts logging before it goes through the actual body of the script. Can someone tweak the script so that it stops logging after it goes through script?
Sorry for the poor explanation
Cheers
# $language = "VBScript"
# $interface = "1.0"
' SendToAll.vbs
Sub Main()
if Not crt.Session.Connected then
szSession = crt.Dialog.Prompt("Enter session:", "", "", False)
if szSession = "" then exit sub
crt.Session.ConnectInTab("/S " & szSession)
crt.Session.ConnectInTab("/S " & szSession)
crt.Session.ConnectInTab("/S " & szSession)
end if
arrCommands = Array("term len 0", "show run", "show ip inte brief", "show cdp neigh",_
"show spanning-tree summary", "show vlan brief", "show vlan", "show spanning-tree root", _
"show spanning-tree uplinkfast", "show spanning-tree backbonefast", "show spanning-tree active", "show spanning-tree blockedports",_
"show spanning-tree mst", "show vtp status", "show interfaces trunk", "show etherchannel summary", "show vlan access-map", "show arp access-list",_
"show vlan filter", "show port-security", "show standby brief", "show ip arp inspection", "show ip route")
' Send commands to all tabs
' Connect to each tab in order from left to right, issue all commands, and
' then disconnect...
' crt.Session.Log True
For nIndex = 1 to crt.GetTabCount
Set objCurrentTab = crt.GetTab(nIndex)
objCurrentTab.Activate
If objCurrentTab.Session.Connected = True Then
objCurrentTab.Session.Log True
For Each strCommand In arrCommands
crt.Sleep 500
objCurrentTab.Screen.Send strCommand & vbcrlf
crt.Sleep 1000
Next
End If
Next
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER