Solved

ping a list of computers by name

Posted on 2009-07-15
5
645 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
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…

943 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