for each $file in FileList('\\server\share,'.pdf')
? $file
next

code:
 
Function FileList($folderName,optional $mask)
$objDir = CreateObject("Scripting.FileSystemObject").GetFolder($folderName).Files
if @error exit 1 endif ; usually folder not found
For Each $objFile In $objDir
$name=$objFile.name
if ($mask and instr($name,$mask)) or not $mask
$t=$t+'|'+$name
endif
Next
$FileList=split(substr($t,2),'|')
EndFunction


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