Hi there ,

the following is supposed to return the ip address of a known host (who's name is resolved to an ip).

I know it works on Windows NT and Windows 2K, and wonder if it works on 9x and XP also ...

code:

break on cls


$Computer = 'Any host with name resolution'
$ipfile = '%temp%\ip.txt'


shell '%Comspec% /q /e:1024 /c for /F "tokens=2 delims=[]" %%i IN ('+ chr(39) + '"ping $Computer -n 1 | find "]""' + chr(39) + ') do echo %%i >' + $ipfile


$ = open(1,$ipfile,2)
$ip = readline(1)
$ = close(1)
del $ipfile
? $ip ?


get $


Thanx in advance

Jochen

[ 06 August 2001: Message edited by: jpols ]

_________________________