Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logon with Telnet

Status
Not open for further replies.

chiuhong

Technical User
Jun 28, 2000
26
HK
we are not sure if you can help here? please read below which are the scripts logon using by modem dial up. BUT we are planning to logon using telnet functions, do you have any ideas change below for ...?

Thanks



proc main
integer Looping = 1, Cnt = 1
set dial retries 3
connect DATA S0
While $Dialing ; wait for dial-up
EndWhile
if $CARRIER
S9 = $CNCTMSG
transmit "^M"
transmit "^M"
transmit "^M"
pause 2
transmit S4
transmit "^M"
while Looping
Cnt++
waitfor "Welcome" 1
if Cnt > 10
Looping = 0
elseif SUCCESS
Looping = 0
else
transmit S1 ; Store Logon Code
transmit "^M"
endif
EndWhile
transmit "^M"
transmit "^M"
Looping = 1
Cnt = 1
While Looping
Cnt++
waitfor "Username:" 1
if Cnt > 10
Looping = 0
elseif SUCCESS
Looping = 0
else
transmit "^M"
endif
EndWhile
transmit S2 ; User ID
transmit "^M"
waitfor "Password:"
transmit S3 ; Password
transmit "^M"
waitfor S4 ; Store Code
if SUCCESS
I0 = 1
else
transmit "log^M"
pause 2
disconnect
endif
endif
endproc
 
If you change connect DATA S0 to connect TELNET S0 (and a telnet entry for S0 exists in the Connection Directory), then the rest of your script should work as-is, as long as the responses from the telnet system are the same as the modem system.


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top