Jump to content

Ping


nobby
 Share

Recommended Posts

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

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

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