Jump to content

Recommended Posts

Posted (edited)

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
Posted

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
Posted

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

Posted

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.

Posted

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...