Jump to content
Sign in to follow this  
sumit

finding ip address when computer name is known

Recommended Posts

sumit

guys I need a script for finding ip address when computer name is known ( for a network ). Please give any suggestions ...

Share this post


Link to post
Share on other sites
andyvl

ping it

(you can use doscommands)

then investigate the output

func _ping($computername)

local $result

$ping_PID = runwait(@comspec & " /c ping " &computername, '', @sw_hide, 2)

while 1

$pingresult = stdoutread($ping)

if @error then

exitloop

return -1

endif

if $pingresult then

$result $=$pingresult

else

sleep(10)

endif

wend

return $result

endfunc

then it's just stringmanipulation on the returnvalue

Share this post


Link to post
Share on other sites
andyvl

TCPNameToIP ( name )

in help file.

this is indeed easier then mine :)

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.