Sign in to follow this  
Followers 0
PolyJorge

Ping [Help me with this script]

3 posts in this topic

Please help me with this "Ping" script..

the code is working but i want to made it like.. i want to ping multiple IP.. around 10 IP's and it will display together.. any suggestion is Ok... Many Thanks

HotKeySet("{ESC}", "Terminate")

While
$var = Ping("10.10.70.1",250)
If $var Then; also possible:  If @error = 0 Then ...
    ToolTip("10.10.70.1 = Online", 0, 0)
Else
    ToolTip("10.10.70.1 = Offline", 0, 0)
EndIf
WEnd

Func Terminate()
    Exit 0
EndFunc

Share this post


Link to post
Share on other sites



Welcome,

Try something like:

For $i = 1 to 10
    $ip = "192.168.0." & $i
    $var = Ping ($ip, 250)
    If $var Then
        ConsoleWrite ($ip & " is Online" & @CRLF)
    Else
        ConsoleWrite ($ip & " is Offline" & @CRLF)
    EndIf
Next

If you need different IPs (192.168.0.100 say, and 172.16.0.1 and others) you will probably need to search up on using arrays.

Cheers,

Brett

Share this post


Link to post
Share on other sites

Thanks >_

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