modify the UDF like this for testing:

? "$directory\$mask"
shell '%comspec% /c dir "$directory\$mask" /b $subdir'
$E = WshPipe('%comspec% /c dir "$directory\$mask" /b $subdir',1)
? ubound($e)
redim preserve $e[ubound($e)-1]
_________________________
How to ask questions the smart way <-----------> Before you ask