Here is the code:

code:

$dirs=dirplus("\\@wksta\users$$", "*.*", 1, 0)

for each $sFilename in $dirs

; $sFilename=$oDirFile.ReadLine() ; read filename from list
$oFile=$oFS.GetFile($sFilename) ; get time/date of this file
if not @error
$sDate=split($oFile.DateLastAccessed(), " ")[0] ; capture the date part of this time/date info
$saDate=split($sDate, "/") ; split the date into it's parts for checker
if DateMath(@date, $saDate[2]+"/"+$saDate[1]+"/"+$saDate[0])>$iCheckAge ; check date against today
$sUser=split($sFilename, "\")[4] ; capture the user name from the path
$sFilename="H:\"+right($sFilename, len($sFilename)-len($sUser)-17) ; capture the filename
$sDate "," $sUser "," $sFilename ? ; display to screen > csv file
endif
endif
next


Here is the DIRPLUS UDF

The UDF averages 50% cpu then when the For Each kicks in, bang 100% flat line. I could put a sleep 1 in there, sure, but when are looking at 115000 array elements, that would make this 2 hour script take an extra 32 hours!

I would be happy to make it take 4 hours if it would keep to 50% CPU.

Any ideas?

cj