Re: Can't Telnet to Cisco equipment - WeOnlyDo Discussion board

Re: Can't Telnet to Cisco equipment (General questions)

by rpissm, Tuesday, February 05, 2008, 21:08 (5925 days ago) @ woddrazen

Hi Johnny,


Please try something like this:
[code]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 = IP
wodSSH1.Login = USER
wodSSH1.Password = PASS
wodSSH1.Connect

wodSSH1.WaitFor ( regex:[$ #>] $ ) 'wait for prompt
wodSSH1.DataReady = 0
Wscript.Echo(wodSSH1.Execute( show ver + vbLf, regex:[$ #>] $ )) 'execute command and receive it in message box
wodSSH1.Disconnect[/code]
Let us know how it goes.


Regards,
Drazen

Hello again,

I tried your code and it worked with a little tweaking of the regexes. Thanks. However, I'm encountering the dreaded --More-- Cisco prompt when I run the command. I was wondering how to use the Peek method, since I could write a loop that looks for the --More-- prompt and deal with it accordingly, since I don't know how many times I'll get the --More-- prompt when I run a command. It might be once, or it might be twenty times. I don't have the access priveleges to do the term 0 command.

I've tried Peek ing at the buffer while the script is running, but it never returns any data.

Any ideas?

Thanks,

Johnny.


Complete thread: