the problem is, that if the target PC that I wish to get the MAC of, has been off long enough, the arp cache on whatever PC queried, will not have it.

I have found a kludge of a solution..., but there has to be a better way:

code:
 
$Mac = GetMac('wheelerc_2nd', 'ada06')
shell '\\a06\logon\tools\wol.exe ' + $mac


Function GetMac($ip, $dhcpServer)
DIM $logs, $found, $file, $arr

$logs=enumdir('\\'+$dhcpServer+'\admin$$\system32\dhcp\','dhcpsrvlog.*',1)
$found=0
for each $file in $logs
if $found=0
if open(1,$file,2)=0
$line=readline(1)
while @error=0 and $found=0
if instr($line,$ip) and (instr($line,'Assign') or instr($line,'renew'))
$arr =split($line,',')
$GetMac = $arr[ubound($arr)]
$found = 1
endif
$line=readline(1)
loop
$=close(1)
endif
endif
next
if $GetMac='' exit (1) endif
endfunction

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