Re: Cant Telnet to Cisco equipment - WeOnlyDo Discussion board

Re: Cant Telnet to Cisco equipment (General questions)

by rpissm, Wednesday, February 06, 2008, 19:35 (6136 days ago) @ woddrazen

Hello again,

YAHOOOOOOOOOOOOOOOOOOOOOOOOOO! IT WORKED!!!!!!!!!!!!!!!!!!!!

Here's the entire script, which will be of use to many of us who are trying to Telnet to Cisco equipment:

----------------
Set wodssh1 = WScript.CreateObject( WeOnlyDo.wodSSHCom.1 )

wodSSH1.Protocol = 1 'Telnet
wodSSH1.Port = 23 ' first Protocol then Port Property
wodSSH1.Timeout = 10
wodSSH1.Blocking = 1 'True
wodSSH1.HostName = HOST
wodSSH1.Login = USERID
wodSSH1.Password = PASSWORD

wodSSH1.StripANSI = True
wodSSH1.Connect

Dim a,b,wodSSH1

wodSSH1.WaitFor ( regex:[$ #>]$ )
wodSSH1.DataReady = 0
wodSSH1.Send show interface + vbLf ' Cisco command goes here

b = CStr(wodSSH1.WaitFor( --More-- ))

On Error Resume Next
wodSSH1.Timeout = 10
Do
wodSSH1.Send ( )
a = CStr(wodSSH1.WaitFor( --More-- ))

If Err.Number <> 0 Then
a =
End If

b = b + a
Loop Until Len(a) = 0
b = b + wodSSH1.Receive 'receive rest

wodssh1.send exit & vblf
Wscript.Echo( b )

----------------

Thank you again for your speedy assistance!

Johnny
[:cool:][:cool:][:cool:][:cool:][:cool:]


Complete thread: