General discussion

  • Creator
    Topic
  • #2179149

    Ping Network

    Locked

    by sprocket ·

    How can i ping all IP Addresses on a network to see which are used and which are free?

All Comments

  • Author
    Replies
    • #3136286

      Reply To: Ping Network

      by neilb@uk ·

      In reply to Ping Network

      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.

      • #3136280

        Reply To: Ping Network

        by sprocket ·

        In reply to Reply To: Ping Network

        I have VB Studio 6 installed on my machine, but i havent actually used it.

    • #3136277

      Reply To: Ping Network

      by neilb@uk ·

      In reply to Ping Network

      You don’t need VB. VBScript will already be installed on any XP,2K or 2K3 system as a standard MS tool.

    • #3136270

      Reply To: Ping Network

      by sprocket ·

      In reply to Ping Network

      This question was closed by the author

Viewing 2 reply threads