FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Telnet script ( probably ot )
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Telnet script ( probably ot )
Posted: Thu Nov 25, 2010 10:16 AM

Hi,
is it possible from a Fivewin program tu run a script like this?
telnet xxx.xxx.xxx.xxx
user admin
password admin
<command1>
<command2>
<command3>
<command4>
<command5>
EXIT
or alternatively run telnet passing a script as a parameter as this sample in ftp
ftp -s:sendfile.ftp

sendfile.ftp
open xxx.xxx.xxx.xxx
admin
admin
<command1>
<command2>
<command3>
<command4>
<command5>
BYE

Thank in advance

Marco Boschi
info@marcoboschi.it
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Telnet script &quot;Solved&quot;
Posted: Mon Nov 29, 2010 05:15 PM

I send these commands and ...it works fine!
...
...
oTelnet := TSocket():New( nPort )
oTelnet:Connect( cIp )
oTelnet:lDebug := .T.
syswait(1)
oTelnet:GetData()
syswait()
oTelnet:SendData( "admin" + crlf )
SysWait(1)
oTelnet:GetData()
SysWait()
oTelnet:SendData( "admin" + crlf ) // user
oTelnet:SendData( "12345" + crlf ) // password
SysWait(1)
oTelnet:SendData( cComando + crlf )
SysWait()
....
and so on...

Marco Boschi
info@marcoboschi.it
Posts: 20
Joined: Fri Dec 16, 2011 04:17 PM
Re: Telnet script ( probably ot )
Posted: Tue Dec 20, 2011 02:33 PM

Hi Marco, I´m wondering how can i put the feedback with the eventual terminal in my own window/dialog.
In my case, i´m working with a vms session and trying to automate some things, but with your example the session
is "blind". I hope you understand...
Regards.
Roberto.

Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: Telnet script ( probably ot )
Posted: Wed Dec 21, 2011 01:46 PM

In this way
cData := oTelnet:GetData()
you assign to cData variable the content
then you can treat it as a normal variable

Marco Boschi
info@marcoboschi.it

Continue the discussion