Announcement

Collapse
No announcement yet.

Batch file to see if a hostname exists on the network

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Batch file to see if a hostname exists on the network

    Hi all,

    I'm trying to create a batch file that will allow me to enter in a host name/IP address (or to read a list from a file) that will then test to see if the computer is either:

    1 - Online
    2 - Offline (but exists on the network)
    3 - Doesn't exist as a valid host name/IP address

    I've been trying to use a combination of Ping and NSlookup but I'm sure that there is probably a better way of doing it.

    Can anyone help?

  • #2
    Re: Batch file to see if a hostname exists on the network

    Ping and Nslookup will work, but I'd query AD for computer accounts as well.

    Instead of batch scripts, do yourself a favor and use VBScript or Powershell.

    -vP

    Comment


    • #3
      Re: Batch file to see if a hostname exists on the network

      If you prefere using a batch,
      a combination of Ping, NSlookup and DSquery might work.

      additionally, a batch can check for the for the existence of a certain file containing the names or ips of computers. If the file is not found it'll ask the user for entering a name or ip.


      \Rems

      This posting is provided "AS IS" with no warranties, and confers no rights.

      __________________

      ** Remember to give credit where credit's due **
      and leave Reputation Points for meaningful posts

      Comment

      Working...
      X