Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ping mutiple machine names 2

Status
Not open for further replies.

bidon15

MIS
Sep 20, 2003
107
US
Hi there,
How can i write a batch file to ping mutilple machine names (NetBIOS name) that i specify? or i am looking for some tools that allow me to ping mutiple machine names? Does any one know how or where i can dnload nice graphical tool. ;-)
***I tried freeping, but it only allow single IP or hostname at the time.
Thank you very much for your help and reply.

Regards,
 
Bcaster - this was very useful for me. Been looking for this sort of thing for a while. Have a star on me.

[pc]

Graham
 
For just pinging, you can use the FOR command and PING. Create a text file with the netbios names you want to ping and then use the FOR command to do a ping against each netbios name in the list. Pipe the results to another text file. You can use the syntax below as an example ...

for /f %i IN (123dump.txt) do ping -n 1 %i>>123results.txt

The FOR command can be used in conjunction with other commands besides PING, including 3rd party tools. I use it a lot in conjunction with PSTOOLS like PSEXEC. This allows me to create a list of netbios names and then I can use the FOR command along with PSEXEC to pass credentials and run an executable (either local or from share) on each machine in the list.... all with a single command. Here's an example of that command ...

for /f %i IN (123dump.txt) do psexec \\%i -u domainname\adminid -p adminpswrd -c "c:\temp\sample.exe /q
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top