I have UDF'ed the Winscl routine i'll go over it a bit more for testing before it goes into the forum.:



Function WinsResolve($username,optional $winsserver)
    dim $winsserver$ipconfig$line$wins1$wins2$file$WINSarray$ip
    if not $winsserver
        $ipconfig=WshPipe("%comspec% /c ipconfig /all",1)
        for each $line in $ipconfig
            if instr($line,'Primary WINS Server')
                $wins1=trim(split($line,':')[1])
                endif
            if instr($line,'Secondary WINS Server')
                $wins2=trim(split($line,':')[1])
                endif
            next
    if $wins1    $winsserver$wins1    else        $winsserver$wins2    endif
    if not $winsserver    exit 1        return        endif

    $file='c:\winscl.txt'
    del $file
    $X = open (1"$file"5)
    $X = writeline(1"$WINSserver" + @CRLF)
    $X = writeline(1"QN" + @CRLF)
    $X = writeline(1$username + @CRLF)
    $X = writeline(1"1" + @CRLF)
    $X = writeline(1"03" + @CRLF)
    $X = writeline(1"0" + @CRLF)
    $X = writeline(1"EX" + @CRLF)
    $X = Close(1)

    $WINSarray=WshPipe("%comspec% /c winscl.exe T NOME< $file",1)
    del $file
    for each $line in $WinsArray
        if instr($line,'Address is (')
            $IP = split(split($line,'(')[1],')')[0]
                  endif
        next
    if $ip
        $WinsResolve='$ip'
    else 
        exit 1
        return
        endif
    endfunction



[ 06. February 2003, 22:54: Message edited by: Radimus ]
_________________________
How to ask questions the smart way <-----------> Before you ask