Sign in to follow this  
Followers 0
ErinC

Multiple Ping Tool

10 posts in this topic

Hi All,

I've been looking around the internet for a tool that will allow me to copy and paste in a list of PC Names and ping them all but I can't find one.

Can anyone suggest how I might create a script program to achieve this aim ?

Basically I want to be able to ping a lot of PCs at once and receive information on if they respond or not, nothing more complicated than that.

Thanks for your time in advance. :o

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Look in Help under Ping, there's an example there.

Edit: Spelling

Edited by sandyd

----[ SandyD ]---

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Here is a start for you but I'm a bit to busy to make it prettier.

It pings the IP, logs the IP then comma and error result, I'm sure you can change it to what you want.

#include <file.au3>
Dim $aIPList
If Not _FileReadToArray("IPList.txt",$aIPList) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
For $x = 1 to $aIPList[0]
    FileWriteLine ("PingLogFile.txt", $aIPList[$x] & "," & Ping($aIPList[$x]))
Next
Edited by ChrisL

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thanks for your replies, however I cannot find the ping example in the help.

Also, when I run the script you posted Chris, it just comes up with an error on the line include <file.au3> (error: Unknown function name)

The file.au3 file is in C:\Program Files\AutoIt3\Include .. ?

Edited by ErinC

Share this post


Link to post
Share on other sites

Are you using the latest Beta version of AutoIT?

Share this post


Link to post
Share on other sites

Hi, no I'm not using the beta version.

I had made a sillly mistake though .. had somehow missed out the # at the start of the line. The script runs now but still doesn't do what I require ... I need to ping machine names not ip addresses .. and the log file isn't right in it's format or info .. I don't understand the code

Share this post


Link to post
Share on other sites

Hi, no I'm not using the beta version.

I had made a sillly mistake though .. had somehow missed out the # at the start of the line. The script runs now but still doesn't do what I require ... I need to ping machine names not ip addresses .. and the log file isn't right in it's format or info .. I don't understand the code

What I did works with names or IP's

the text file of computers is like:

fm01657

192.168.2.5

192.168.2.11

192.168.2.95

the resulting log file reads:

fm01657,1

192.168.2.5,0

192.168.2.11,1

192.168.2.95,0

Perhaps if you posted your list format and your code it might help

Share this post


Link to post
Share on other sites

just to prove the point, I added in bbc.co.uk to the list

fm01657

www.bbc.co.uk

192.168.2.5

192.168.2.11

192.168.2.95

results:

fm01657,1

www.bbc.co.uk,21

192.168.2.5,0

192.168.2.11,1

192.168.2.95,0

fm01657 replied in 1 ms

www.bbc.co.uk replied in 21ms

192.168.2.5 didn't reply

192.168.2.11 replied in 1ms

192.168.2.95 didn't reply

Share this post


Link to post
Share on other sites

Hi again Chris, and thank you for spending your time on this.

I am using the code;

#include <file.au3>
Dim $aIPList
If Not _FileReadToArray("IPList.txt",$aIPList) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
For $x = 1 to $aIPList[0]
    FileWriteLine ("PingLogFile.txt", $aIPList[$x] & "," & Ping($aIPList[$x]))
Next

The contents of my IPList.txt is;

ARCTDUCZC4070RD

CRELDGC00006

CRELDGC00010

CRELDGC00022

CRLIKN9Z0Z4G

LIBEWRCZC4070RB

LIBEWCZC4070RLW

LIEWJX7ZJ00KPN

LIEWJYHZN3JX

GELIDULJK1J

LIBGTDMLJK1L

CRKL36RLN1J

CRKL5P8MN1J

LIBLKCZC4070RD2

CSLI32608VV

and after running the script, I get the following in the PingLogFile.txt;

LIEWJX7ZJ00KPN,0

LIEWJYHZN3JX,0

ARCTDUCZC4070RD,0

GELIDULJK1J,0

CRELDGC00006,0

LIBGTDMLJK1L,0

CRELDGC00010,0

CRKL36RLN1J,0

CRELDGC00022,0

CRKL5P8MN1J,0

LIBLKCZC4070RD2,0

CSLI32608VV,1

CRLIKN9Z0Z4G,0

LIBEWRCZC4070RB,0

LIBEWCZC4070RLW,0

LIEWJX7ZJ00KPN,0

LIEWJYHZN3JX,0

GELIDULJK1J,0

LIBGTDMLJK1L,0

CRKL36RLN1J,0

CRKL5P8MN1J,0

LIBLKCZC4070RD2,0

CSLI32608VV,1

So from what your example I can see that it is actually working ok after all but it doesn't seem to be giving reliable results when I compare the results of manually pinging the machine names

Share this post


Link to post
Share on other sites

Share this post


Link to post
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
Sign in to follow this  
Followers 0