Solved

ping a list of computers by name

Posted on 2009-07-15
5
641 Views
Last Modified: 2013-11-09
I have the folowing script that can ping computers by IP and returns the name and the result is dumped in the text file.
for /f "tokens=*" %%a in ('type c:\computers.txt 2^>NUL') do ping -a %%a >> c:\result.txt
can someone modify this so that it pings by Name and returns IPs and dumps the result in a text file?

thanks

 

0
Comment
Question by:jskfan
5 Comments
 
LVL 2

Accepted Solution

by:
CptArAb earned 250 total points
Comment Utility
I don`t think thats possible, although i might be wrong. But IMHO, i would rather just use a program like angry IP scanner which can be found at:

http://www.angryziber.com/w/Download

And in the options tell it to only display live IP results. The program already has a built in option to save the result to a text file. So there`s your answer. I`m sure with some creativity you can automate the whole process if need be, else you can even download the source code for free at angryziber`s home page at take it from there.
0
 
LVL 8

Assisted Solution

by:joefreedom
joefreedom earned 250 total points
Comment Utility
repost your question in a scripting zone.  I know you can ping a machine by its hostname using the command line, there has to be a way to script it.  In the script you are running right now it is the "-a" attribute that tells ping to return the hostname so it may be as simple as removing that attribute and making some other minor changes.
0
 

Author Comment

by:jskfan
Comment Utility
actually, I just created a batch file with:
ping comp1
ping comp2
...
...
ping compX
Pause

then copied and pasted it to a text file.
0
 
LVL 8

Expert Comment

by:joefreedom
Comment Utility
glad you figured it out
0
 

Expert Comment

by:PhillyTech
Comment Utility
THIS DOES NOT ANSWER THE QUESTION, IT JUST LIST A SOFTWARE TO DOWNLOAD. GLAD I DID NOT PAY FOR THE WEBSITE YET I ALMOST DID.
0

Featured Post

Are end users causing IT problems again?

You’ve taken the time to design and update all your end user’s email signatures, only to find out they’re messing up the HTML, changing the font and ruining the imagery. What can you do to prevent this? Find out how you can save your signatures from end users today.

Join & Write a Comment

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now