Hi

Quote Originally Posted by Negative
Quick and dirty (and complete if you're lucky): arp -a
Very creative solution to that problem Luck, unfortunately, often is missing ...
you could also ping to the broadcast address and wait for who is answering ...
if there are some sun solaris stations, they may answer ...


Anyway, sometimes it is indeed useful, to have some small script available without
dependencies of 3rd party tools. Once I used a pure batch-script, nowadays
I would write a small vb-script (not even threaded, and thus very slow)
using the WMI framework.

To run use
Code:
>cmd.exe /c ping_subnet.vbs
And ping_subnet.vbs looks like
Code:
Subnet = "192.168.1."

strMessage = "Reachable:" & vbcr
 
For intIP = 1 To 254
	strComputer = Subnet & intIP

	set objWMIPing =  GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery("select * from Win32_PingStatus where address = '" & strComputer & "'")

	for each objStatus in objWMIPing
		if Not IsNull(objStatus.StatusCode) and objStatus.StatusCode=0 then
			strMessage = strMessage  & strComputer & vbcr
		end if
	next	

	
Next 

WScript.Echo strMessage
Be patient, it takes a while ...


If you are interested in scripting, the tales[2] always are a nice starting point.

Cheers


[1] http://msdn.microsoft.com/en-us/libr...50(VS.85).aspx
[2] http://www.microsoft.com/technet/scr...es/sg1102.mspx