Computing.Net > Forums > Disk Operating System > Batch to get from a list in a file.

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch to get from a list in a file.

Reply to Message Icon

Name: skinny_thug
Date: October 5, 2003 at 07:13:11 Pacific
OS: command prompt win2k
CPU/Ram: P4/256
Comment:


I want to get hostnames from a file and make a batch file to ping each hostname in that file.what are the commands that enable me to fulfill that.



Sponsored Link
Ads by Google

Response Number 1
Name: Miskva999
Date: October 5, 2003 at 12:30:17 Pacific
Reply:

This highly depends on the format of your sourcewhere, from which you want to get the names out of


0

Response Number 2
Name: skinny_thug
Date: October 5, 2003 at 13:00:52 Pacific
Reply:

I will have the hostnames in a text file as a list.

I was thinking of something I don't know wether gonna work.
it is as follows.

to have a first file that holds the ping command as follows

@echo off
ping.exe -f %1 -out %1 >NULL
goto retry
:done
-----
to have another file that will read from the text file as follows:

@echo off
For /F "tokens=*" %%I in (C:\hostnames.txt) Do Call Ping %%I
::ping is a batch file that contains the ping command.


would it work that way ?

Thanks alot.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Batch to get from a list in a file.

A batch to read from a file? www.computing.net/answers/dos/a-batch-to-read-from-a-file/4566.html

Set variable to contents of a file. www.computing.net/answers/dos/set-variable-to-contents-of-a-file/13420.html

Get dir files names into a file www.computing.net/answers/dos/get-dir-files-names-into-a-file/12623.html