Re: need help with TelnetDLX - WeOnlyDo Discussion board

Re: need help with TelnetDLX (General questions)

by Kevin Hall, Monday, June 22, 2009, 19:51 (5634 days ago) @ woddrazen

Thats exactly what I need but how do I switch prompts... When you send a new user su

Option Explicit
Dim tel1, mcol, servColl, server_hostname, server_login, server_password, first, second, serverNum, mExecuted
Set tel1 = WScript.CreateObject( WeOnlyDo.wodTelnetDLXCom.1 )
Set mcol = WScript.CreateObject( Scripting.Dictionary )

mcol.add 1, someserver/usera/

serverNum = 0
Do
serverNum = serverNum + 1

servColl = mcol.item(serverNum)
first = InStr(1, servColl, / )
Second = InStr(first + 1, servColl, / )
server_hostname = Left(servColl, first - 1)
server_login = Mid(servColl, first + 1, Second - first - 1)
server_password = Right(servColl, Len(servColl) - second)

tel1.Timeout = 100
tel1.Protocol = 1
tel1.Blocking = 1
tel1.Port = 23
tel1.HostName = server_hostname
tel1.Login = server_login
tel1.Password = vbNullString
tel1.Connect

tel1.WaitFor ( regex:[$ #>:] $ )
tel1.DataReady = 0

mExecuted = tel1.Execute( cat /usr/spool/output/reportprnt/status + vbLf, regex:[$ #>:] $ )
WScript.Echo mExecuted

'When the queue is good it will says sending to REPORTPRNT
If InStr(1, mExecuted , sending to REPORTPRNT ) Then
Else

mExecuted = tel1.Execute( cd /usr/spool/output/reportprnt/ + vbLf, regex:[$ #>] $ )
WScript.Echo mExecuted

'######## HOW DO I SWITCH PROMPTS HERE TO WAIT FOR THE password:
'tel1.WaitFor ( regex:[$ #>:] : )
mExecuted = tel1.Execute( su + vbLf, regex:[$ #>:] : )
WScript.Echo mExecuted

mExecuted = tel1.Execute( suPassord + vbLf, regex:[$ #>] passowrd: )
WScript.Echo mExecuted [code][/code]


Complete thread: