5 replies
A vbscript will do it
--------------
Option Explicit
Dim objShell, strSubnet, i
Set objShell = CreateObject("WScript.Shell")
strSubnet = "10.130.32." 'Obviously set this to yours! And note the trailing stop
For i = 1 to 255
If IsUp(strSubnet & i) Then
wscript.echo strSubnet & i & " is up"
End If
Next
wscript.quit(0)
' ---------------------------------
Function IsUp(sIPAddress)
Dim stdOut, objScriptExec, strPingResults
Set StdOut = WScript.StdOut
On Error Resume Next
Set objScriptExec = objShell.Exec("ping -n 2 -w 500 " & sIPAddress)
strPingResults = LCase(objScriptExec.StdOut.ReadAll)
Set stdOut = Nothing
set objScriptExec = Nothing
IsUp = False
If InStr(strPingResults, "reply from") Then IsUp = True
End Function
---------------
Save it as, say, scansubnet.vbs and then run cscript scansubnet.vbs in a CMD box.
by sprocket
by sprocket
Poster rated this answer.
by sprocket
This discussion is closed to new replies.
Trending Networks posts
Sort by Trending