Re: Can't Telnet to Cisco equipment (General questions)
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.ConnectwodSSH1.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:
- Can't Telnet to Cisco equipment - rpissm, 2008-02-05, 19:54
- Re: Can't Telnet to Cisco equipment - woddrazen, 2008-02-05, 20:05
- Re: Can't Telnet to Cisco equipment - rpissm, 2008-02-05, 21:08
- Re: Cant Telnet to Cisco equipment - woddrazen, 2008-02-05, 23:25
- Re: Cant Telnet to Cisco equipment - rpissm, 2008-02-06, 19:35
- Re: Cant Telnet to Cisco equipment - woddrazen, 2008-02-05, 23:25
- Re: Can't Telnet to Cisco equipment - rpissm, 2008-02-05, 21:08
- Re: Can't Telnet to Cisco equipment - woddrazen, 2008-02-05, 20:05