Automating a Script (General questions)
This issue is found using Visual Basic 2005 Express.
Problem: Trying to auto login to a SSH server, automate the prompts to put the user at a certain spot without having the user select the ANSI menus directly. I program needs to wait after each menu selection for some text on the next menu screen before sending the next menu command.
Solution Attempt: I have added the code that i use and the code logs in and runs the first menu option and then exits no matter what I do to continue.
[code]
Telnet1 = New WODTELNETDLXCOMLIB.wodTelnetDLXCom
'GetLoginInfo()
Telnet1.Hostname = DEV1
Telnet1.Login = p5104
Telnet1.Password = p5104
Telnet1.Protocol = WODTELNETDLXCOMLIB.ProtocolsEnum.SSHAuto
Telnet1.TerminalType = tty
Telnet1.StripANSI = True
AddToList( Connecting... & vbCrLf)
Telnet1.Blocking = True
Telnet1.DebugFile = c:debug.txt
Telnet1.Connect()
On Error Resume Next
' if all succeeded
Telnet1.WaitFor( Select , 30)
Telnet1.DataReady = 0
Telnet1.Execute( e & vbCrLf, Select: , 30)
Telnet1.DataReady = 0
Telnet1.Execute( 51 & vbCrLf, Location , 30)
Telnet1.DataReady = 0
Telnet1.Execute( & vbCrLf, F4 , 30)
Telnet1.DataReady = 0
Telnet1.Execute( s5100 & vbCrLf, Password , 30)
Telnet1.DataReady = 0
Telnet1.Execute( s5100 & vbCrLf, Site , 30)
Telnet1.DataReady = 0
Telnet1.Execute( s5100 & vbCrLf, Select , 30)
Telnet1.DataReady = 0
Telnet1.Execute( 3 & vbCrLf, Select , 30)
Telnet1.DataReady = 0
Telnet1.Execute( 3 & vbCrLf, Select , 30)
Telnet1.DataReady = 0
Telnet1.Execute( bkn & vbCrLf, Employee , 30)
Telnet1.DataReady = 0
Telnet1.Send( wrkrb & vbCrLf)
AddToList( Completed Login Process... & vbCrLf)
[/code]
Code fails after 1st execute.
Error in VB is:
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in Project1.exe
Any ideas would be appreciated. I would like to create a front end to a server app that can be scripted and am out of ideas. I check through the forums but no luck.
Regards,
Eric
Complete thread:
- Automating a Script - Eric Grau, 2007-11-26, 18:36
- Re: Automating a Script - wodDamir, 2007-11-26, 18:49
- Re: Automating a Script - Eric Grau, 2007-11-26, 18:57
- Re: Automating a Script - wodDamir, 2007-11-26, 19:22
- Re: Automating a Script - Eric Grau, 2007-11-26, 19:34
- Re: Automating a Script - wodDamir, 2007-11-26, 19:22
- Re: Automating a Script - Eric Grau, 2007-11-26, 18:57
- Re: Automating a Script - wodDamir, 2007-11-26, 18:49