Sign in to follow this  
Followers 0
nobby

Ping

6 posts in this topic

#1 ·  Posted (edited)

When trying to ping an IP address, I get an @error 4, but when I ping the hostname, it is successful.

;;does not ping
$var = Ping("127.0.0.1")
If $var Then; also possible:  If @error = 0 Then ...
    Msgbox(0,"Status","Online, roundtrip was:" & $var)
Else
    Msgbox(0,"Status","An error occured with number: " & @error)
EndIf

;;does ping
$var = Ping("localhost")
If $var Then; also possible:  If @error = 0 Then ...
    Msgbox(0,"Status","Online, roundtrip was:" & $var)
Else
    Msgbox(0,"Status","An error occured with number: " & @error)
EndIf

Any ideas?

Forgot to mention that it is with the latest 1.03 version Oct 12.

Edited by nobby

CheersNobby

Share this post


Link to post
Share on other sites



Yes I think it's a bug.

The only way I found to force Autoit to ping a host with known IP address is to add a line with its IP address and fake hostname to %SystemRoot%\System32\Drivers\Etc\Hosts

For host 10.0.0.1 I'm using FileWriteLine to add following line:

10.0.0.1 temp10.0.0.1

and then I'm calling Ping function for host: "temp10.0.0.1"

--

WoWi

Share this post


Link to post
Share on other sites

well, happens to me too, looks bug like to me.


"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Yeah, it's a but, I see the problem now in the source. :)

Sorry, didn't see that.

The change was around the 02.10. I don't know why...

However, I try to solve it and sent the solution to Jon.

Thanks Holger :)

Edited by Holger

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  
Followers 0