The @wksta and @ipaddress0 definitley makes it cleaner. I'm a little confused about using the IsStringInFile UDF as part of the script though.

Would the $filename=ipaddress0 and the $string=c:\kixtart\ipadds.txt

[CODE]

function IsStringInFile($filename,$string)

$isstringinfile=0 if $string=''
exit 87
endif

if not exist($filename)
exit 2
endif

shell '%COMSPEC% /e:1024 /c find /c /i "'+$string+'" "'+$filename+'" > nul'
if @ERROR=0
$IsStringInFile=1
endif
exit 0

endfunction