and here is the latest and greatest... a number of bug fixes included. requires the WshPipe() UDF and dhcpcmd.exe from reskit
code:
 
$dump=EnumMAC('192.168.0.2')
for $item = 0 to ubound($dump,2)
? $dump[0,$item] +' '+ $dump[2,$item] +' '+ $dump[1,$item]
next

$mac = EnumMAC('192.168.0.2','192.168.0.103')[2,0]
if not @error
? $mac
shell 'cmd /c \\server\tools\wol.exe ' + $mac +' > nul'
endif

code:
 
Function EnumMAC($server, Optional $ip)
DIM $DHCPCMD, $command, $line, $x, $addr, $host, $mac, $scope, $superscope
DIM $arrTemp[2,0]

$DHCPCMD = '\\a06\logon\tools\dhcpcmd.exe'

$x = 0
$command = 'cmd /c ' + $DHCPCMD +' '+ $server +' getsuperscopetable | find "Subnet"'
$superscope = WSHPipe($command,1)
for each $scope in $superscope
$subnet = trim(split(split($scope,'=')[1],chr(13))[0])
if len($subnet)
$command = 'cmd /c ' + $DHCPCMD +' '+ $server +' enumclients ' + $subnet+' -h'
if $ip
$command = $command + ' | find "' + $ip + '"'
endif
$output = WSHPipe($command,1)
For each $line in $output
if val(left($line,2))
$line=split(split($line,chr(9))[1],chr(13))[0]
$arrTemp[0,$x] = trim(substr($line,1,16))
$arrTemp[1,$x] = split(trim(substr($line,17,16)),'.')[0]
$arrTemp[2,$x] = trim(substr($line,35,13))
$x = $x + 1
redim preserve $arrTemp[2,$x]
endif
next
endif
next
if $x
redim preserve $arrTemp[2,$x-1]
$EnumMAC = $arrTemp
else
exit (1)
endif
EndFunction

_________________________
How to ask questions the smart way <-----------> Before you ask