Jump to content

Who's in my network


Recommended Posts

Try this:

#Include <Array.au3>
#include <iNet.au3>
TCPStartup()

Global $aComputers[255][2]
Global $count = 0
Global $IP = @IPAddress1

$minIP = 100;192.168.0.100 is the lowest IP i have
$maxIP = 110;192.168.0.110 is the highest IP i will have, so no need to go higher/lower

If $IP = "127.0.0.1" Then
    MsgBox(0, "Error", "It appears no connection is availible.  Now exiting...")
    Exit
EndIf

$aIP = StringSplit($IP, ".")

If $aIP[0] <> 4 Then
    MsgBox(0, "", "Invailid IP (Possibly using IPv6),  Now exiting...")
    Exit
EndIf

$pre = $aIP[1] & "." & $aIP[2] & "." & $aIP[3] & "."

For $i = $minIP to $maxIP
    $pingIP = $pre & $i
    TrayTip ("", "Now Pinging... " & $pingIP, 10)
    $ping = Ping ($pingIP, 75)
    If $ping Then
        $name = _TCPIpToName ($pingIP)
        If @error Then $name = -1 & "(error = " & @error & ")"
        $count += 1
        $aComputers[$count][0] = $pingIP
        $aComputers[$count][1] = $name
    EndIf
Next

MsgBox (0, "", $count & " computers found!")

ReDim $aComputers[$count + 1][2]
$aComputers[0][0] = $count
_ArrayDisplay ($aComputers)
TCPShutdown ( )

Cheers,

Brett

Link to comment
Share on other sites

Thats something like i want, but i turned up that there wasnt any.

Maybe this will clarify:

The computers in the Network folder shows like 40+ computers. i want that in a list.

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

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...