Mass ping bat file using hostnames

March 13, 2009 at 11:55:02
Specs: Server 2003
I was asked to clean up an SMS server and I've noticed a lot of the computers on the list are not reporting as contactable. Its not likely that these are all offline as we've had some problems with the local SMS client on these desktops. To save me some time I'd like to create the following.

I'd like to create a BAT file that will:

1. Ping a workstation based off the desktops hostname for a minimum of 8 tries but no more then 20

2. Report only the computers that reply in a text file


Honestly my knowledge with scripting is horrible and I don't know how to do this. The server is Win2003 and I'm pinging WinXP boxes. If anyone can help me with this it is appreciated greatly. Thanks


See More: Mass ping bat file using hostnames

Report •


#1
March 13, 2009 at 19:24:02
How many machines are you talking about here?

It can be quite slow to ping with the timeouts involved and that needs multiplied over the number of machines. There are ways of speeding things up by using multiple threads, machines or both.

Also when you say 8-20 tries do you mean one attempt after another of staggered over a period of time?

Is this over lan or internet connections, fast or slow?

Are third party tools an option? There might be something out there that can pick up your list and do the job for you.

It is certainly possible, but without the details it is a little hard to say which direction is best.


Report •

#2
March 13, 2009 at 21:15:02
i think the ping time can be reduced like this:
1. ping once only on each host
2. if host reply, move on to another host, if host does not reply, do another ping, eg ping -n 5 hostname.

i am also wondering why ping 8-20 times???


Report •

#3
March 14, 2009 at 14:28:25
>>>>>>It is certainly possible, but without the details it is a little hard to say which direction is best.

No worries I got something that will work yesterday. Thanks for the reply. This looks like a great community!


Report •

Related Solutions

#4
March 14, 2009 at 14:30:22
>>>>>>>>i am also wondering why ping 8-20 times???

I was dealing with multiple domains across several states and one overseas. 8 tries would be better then 4. Thanks for the reply


Report •

#5
April 25, 2009 at 10:44:17
Addicted- what did you end up using for your .bat file?

Report •


Ask Question