just want to make sure i am 100% on what you are wanting to do.
You want to rename all *.log files in a folder to "file#.log" # equals a increasing counter. But you dont want to rename "archive.log" is that correct?
While you answer taht, a few pointers that i am spotting that will lead to problems.
(be sure that you got DIRPlus 2.31 (i had a small bug fix)
1.
$folder = "c:\temp"
$archive=$folder+"archive.log"
$archive is equal to "c:\temparchive.log"
you are missing a "\"
$archive=$folder+"\archive.log"
2.
DirPlus returns an array of FSO objects, so i am unsure how well remfromarray() will handle this.
one method would be to do something like this.
Code:
$folder = "c:\temp"
$archive= "archive.log"
$dir = dirplus($folder,"/a-d /f log")
For Each $file in $dir
if $file.name <> $archive
$file.Move($folder + "\file"+$i+".log")
$i = $i+1
endif
Next