Thank you. I'm having one issue now using this and the remfromarray() udf. I just get all the output filenames redirected to the console. The code you posted works excellently, and I could move or copy the file before creating the array, but I'd rather leave the file in place and remove the element if possible.


$folder = "c:\temp"
$archive=$folder+"archive.log"

$dir = dirplus($folder,"/a-d /f log")
$dir1=remfromarray($dir,$archive)

For Each $file in $dir1
$file.Move($folder + "\file"+$i+".log")
$i = $i+1

Next
_________________________
I could have made a neat retort but didn't, for I was flurried and didn't think of it till I was downstairs.
-Mark Twain