0

I have been given a list of server names and asked to retrieve their fully qualified domain name.

SERVER1
SERVER2
SERVER3

in the company we have multiple potential FQDN so I have been given a basic cmd file to run

@ECHO OFF
PING %1.EXAMPLE.COM
PING %1.EXAMPLE2.COM

You can see the purpose is to ping all potentials till I get a return and that will be the FQDN.

However there are 600 for me to ping. I am wondering if it is possible to read the list of servers from a text file all at once and return the results of the pings to another text file. Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
cozbouk
  • 17
  • 1
  • 6
  • `for /f %A in (c:\myfile.txt) do echo %A` See `for /?` as there are heaps of options. If in a batch use `%%A` instead of `%A` when typing. –  May 26 '16 at 11:03
  • See also `ping /?` for options. – lit May 26 '16 at 18:32

0 Answers0