Solved

ping a list of computers by name

Posted on 2009-07-15
5
648 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
ID: 24863595
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
ID: 24863781
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
ID: 24864442
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
ID: 24864457
glad you figured it out
0
 

Expert Comment

by:PhillyTech
ID: 37943245
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

816 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

8 Experts available now in Live!

Get 1:1 Help Now