PerryRaptor Posted December 18, 2005 Share Posted December 18, 2005 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 More sharing options...
PartyPooper Posted December 18, 2005 Share Posted December 18, 2005 Just a thought PerryRaptor for future versions, but you may want to add some error checking in regards to using pings. Many firewalls and routers now block ICMP protocols and you end up with time outs instead of ping values. Link to comment Share on other sites More sharing options...
PerryRaptor Posted December 18, 2005 Author Share Posted December 18, 2005 If you enter an invalid I.P. Address or HostName it returns nothing. Also, the cancel button isn't enabled either. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now