Jump to content

Display HostName or I.P. Address


PerryRaptor
 Share

Recommended Posts

No break throughs; just sharing...

Need to lookup the ComputerName, HostName, or I.P. Address for an Internet/Network resource?

; Host_IP.au3
;
; Executes the MSDOS Ping command against a targeted Internet or Networked resource
; - Ultimately returning only the I.P. Address or HostName of the target
; - Creates a temporary text file to hold the result of the MSDOS Ping command
; Version 1.0.3 By: PerryRaptor
; ----------------------------------------------------------------------------------
Local $strcomputer,$ip
$strcomputer = @computername
$strcomputer = InputBox("HostName or I.P. Address", "Enter the ComputerName, HostName, or I.P. Address for a remote PC, a web address, or press the {OK} button to show My_IP.", $strComputer, "")

RunWait(@ComSpec & " /C Ping -a -n 1 " & $strcomputer & "> Host_IP.txt",@MyDocumentsDir, @SW_HIDE)
$ip = FileRead(@MyDocumentsDir & "\Host_IP.txt", FileGetSize(@MyDocumentsDir & "\Host_IP.txt"))
FileDelete(@MyDocumentsDir & "\Host_IP.txt")

$ip = StringTrimLeft($ip, StringInStr($ip, "["))
$ip = StringLeft($ip, StringInStr($ip, "]")-1)

MsgBox(0," " & $strcomputer & ":  ", "   " & $ip)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...