Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22

Thread: ping a list of computer names

  1. #11
    Junior Member
    Join Date
    Dec 2006
    Posts
    28
    Well, none were what I was looking for. LinLover is correct. I want to be able to import, say, an Active Directory extract of computer names in .txt file and ping all of them.
    I found a gui-based app a few years ago that did this but it's like a needle in a haystack now. I'm surprised people don't make stuff like this.
    Last edited by not_it; April 10th, 2007 at 03:44 AM.

  2. #12
    Junior Member
    Join Date
    Sep 2005
    Posts
    1
    I like using Angry IP scanner. It is free and fast.

  3. #13
    Senior Member
    Join Date
    Oct 2003
    Location
    MA
    Posts
    1,052
    I made a batch file similar to this one and it works great:
    http://www.computing.net/programming...rum/14766.html

  4. #14
    Right turn Clyde Nokia's Avatar
    Join Date
    Aug 2003
    Location
    Button Moon
    Posts
    1,696
    100's of handy little ping tools here:

    http://www.freedownloadscenter.com/B...opy-files.html

    All free too.

  5. #15
    Senior Member
    Join Date
    Dec 2001
    Posts
    319
    We just wrote our own in VB.NET. Fairly easy to do, even with a rudimentary understanding of the language.

  6. #16
    Senior Member
    Join Date
    Oct 2003
    Location
    MA
    Posts
    1,052
    lol that was excessive. The framework for .net that is loaded into memory is huge. Here is what I wrote before it works fine.

    file: PINGresults.txt - make a blank file
    file: HOSTS.txt - add each host with a new line for each host not commas or anything like that
    file: PingAll.cmd -

    Code:
    @Echo Off
    
    
    TITLE Ping Test
    
    
    SET MachineList=HOSTS.txt
    SET ResultsFile=PINGresults.txt
    
    
    
    CLS
    ECHO.
    IF NOT EXIST "%MachineList%" (
      ECHO Cannot locate Machine List: %MachineList%
      PAUSE>NUL
      GOTO :EOF
    )
    
    
    FOR /f "tokens=*" %%M in (%MachineList%) do CALL :CHECK "%%M"
    
    GOTO :EOF
    
    :CHECK
    SET Machine=%~1
    SET Machine=%Machine: =%
    
    PING -n 1 %Machine%>NUL
    Echo Processing %Machine%
    IF %ERRORLEVEL% EQU 0 ECHO %Machine% did respond at %Time%>>%ResultsFile% 
    EXIT /B
    
    :EOF
    Its quick, its dirty, its simple, its easy. Just put the hosts in hosts.txt and run pingall.txt and it will ping all of them and it log the ones that did not respond in pingresults.txt

  7. #17
    Senior Member
    Join Date
    Dec 2001
    Posts
    319
    Well, the pinging part was just a small part of a larger picture. There are many other things we're doing with this particular program that can't really be scripted : info gathering, remote task-management, etc...basically a techie 'all-in-one' program.

  8. #18
    Senior Member
    Join Date
    Oct 2003
    Location
    MA
    Posts
    1,052
    sam-spade tools? hehe

  9. #19
    THE Bastard Sys***** dinowuff's Avatar
    Join Date
    Jun 2003
    Location
    Third planet from the Sun
    Posts
    1,253
    Code:
    On Error Resume Next
     
    If Wscript.Arguments.Count = 0 Then
        Wscript.Echo "You must enter the computer name when starting this script."
        Wscript.Quit
    End If
     
    strComputer = Wscript.Arguments.Item(0)
     
    Set objShell = CreateObject("WScript.Shell")
    strCommand = "%comspec% /c ping -n 3 -w 1000 " & strComputer & ""
    Set objExecObject = objShell.Exec(strCommand)
     
    Do While Not objExecObject.StdOut.AtEndOfStream
        strText = objExecObject.StdOut.ReadAll()
        If Instr(strText, "Reply") > 0 Then
     
            ' =====================================================================
            ' Insert your code here
            ' =====================================================================
     
            Set objComputer = GetObject("WinNT://" & strComputer & "")
            objComputer.Filter = Array("User")
            For Each objUser in objComputer
                Wscript.Echo objUser.Name
            Next
     
            ' =====================================================================
            ' End
            ' =====================================================================
     
        Else
            Wscript.Echo strComputer & " could not be reached."
        End If
    Loop
    Or something to that effect. You could pull from a csv file if you wanted to
    09:F9:11:02:9D:74:E3:5B8:41:56:C5:63:56:88:C0

  10. #20
    AO übergeek phishphreek's Avatar
    Join Date
    Jan 2002
    Posts
    4,325
    Quote Originally Posted by not_it
    Well, none were what I was looking for. LinLover is correct. I want to be able to import, say, an Active Directory extract of computer names in .txt file and ping all of them.
    I found a gui-based app a few years ago that did this but it's like a needle in a haystack now. I'm surprised people don't make stuff like this.
    I realize that this thread is a bit old... but nmap will do that too.

    nmap -sP -iL c:\cnames.txt

    You may just have to format the export from AD. But, that is easy enough.

    If you want a GUI, then there are several to choose from.
    http://insecure.org/nmap/
    Quitmzilla is a firefox extension that gives you stats on how long you have quit smoking, how much money you\'ve saved, how much you haven\'t smoked and recent milestones. Very helpful for people who quit smoking and used to smoke at their computers... Helps out with the urges.

Similar Threads

  1. Tips
    By XTC46 in forum Site Feedback/Questions/Suggestions
    Replies: 15
    Last Post: August 24th, 2005, 07:52 PM
  2. Intro To Computer Building and Hardware
    By Status in forum Other Tutorials Forum
    Replies: 4
    Last Post: January 4th, 2004, 04:02 PM
  3. Computer dictionary
    By ar_wind in forum Tech Humor
    Replies: 0
    Last Post: November 19th, 2003, 01:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •