Jump to content
Sign in to follow this  
tal041482

Telnet Issue

Recommended Posts

tal041482

Ok everyone here is the deal

the script executes to the end with no errors but nothing happens any ideas?

$res = RunWait(@ComSpec & ' /c ping -n 1 www.google.com | find /i "100"','',@SW_HIDE)

msgbox(0,'debug',$res)

if $res = 1 then

TCPStartup()

$socket = TCPConnect("192.168.14.1", 23)

Sleep(1000)

TCPSend($socket, "password")

Sleep(1000)

TCPSend($socket, "en")

Sleep(1000)

TCPSend($socket, "password")

Sleep(1000)

TCPSend($socket, "config t")

Sleep(1000)

TCPSend($socket, "hostname blabla")

Else

EndIf

Exit

Anyways do i need to a send return ?

Edited by tal041482

Share this post


Link to post
Share on other sites
notsure

I did alot of telnet coding in the past. I still remember 1 time I was trying to configure a router the router only accepted 1 character per "send".

Try this;

#include <string.au3>
local $len, $socket, $data

TCPStartup()
$socket = TCPConnect("192.168.14.1", 23)

if $socket <> "-1" then
$data = "password" & @CRLF
$len = stringlen($data)

for $i = 0 to $len
    tcpsend($socket, stringmid($data,1,1))password
    $data = stringmid($data, 2, $len)
    
next
endif

Share this post


Link to post
Share on other sites
SimonWebstation

is the ip from google or from your pc when it isn't from google and you wold like to send something to google then lool up in the help for tcpnametoip


mfg. SimonMany of my answers are translated of google, because I'am from Germany

Share this post


Link to post
Share on other sites
notsure

is the ip from google or from your pc when it isn't from google and you wold like to send something to google then lool up in the help for tcpnametoip

Thats true, but he's doing the ping in DOS, and the DOS-Ping recognizes google.nl if DNSaddresses are filled properly.

Share this post


Link to post
Share on other sites
SimonWebstation

Thats true, but he's doing the ping in DOS, and the DOS-Ping recognizes google.nl if DNSaddresses are filled properly.

you can try tcpnametoip it can be that you have made

RunWait(@ComSpec & ' /c ping -n 1 www.google.com | find /i "100"','',@SW_HIDE)

false and it doesnt came the right answer


mfg. SimonMany of my answers are translated of google, because I'am from Germany

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×