Well the cleantempfiles will not work.. like an idiot I modified it as seen below but only to realize it only works at the file level because it is using GetFileTime() which does not work on directories! Any thoughts now...

What I need to to is move directories that are a certain age out to another location.

Thanks

code:
 ;FUNCTION      CleanTempFiles
;
;AUTHOR Jens Meyer (sealeopard@usa.net)
;
;VERSION 1.1
;
;ACTION Cleans up the temporary directory
;
;SYNTAX CLEANTEMPFILES(ACTION,DIRECTORY,Optional DESTINATION,FILTER,DAYS)
;
;PARAMETERS ACTION
; Required switch that controls the action of the UDF
; 1-Deletes files
; 2-Moves files
;
; DIRECTORY
; Required string/array containing the directory(s) to be cleaned\
;
; DESTINATION
; OPTIONAL String containing the directory to which files will be moved
;
; FILTER
; Required string/array containing file filters for deletables files/folders, wildcards are supported
;
; DAYS
; Required integer indicating how old a file must be before it is deleted
;
;REMARKS The function will recursively delete all empty subdirectories and files
; Requires the global variable $VERBOSE (true for verbose output)
;
;DEPENDENCIES FULLFILE() @ http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000028
; DATEMATH() @ http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000102
; DISPLAYTEXT() @ http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000036
;
;RETURNS 0 if successful, otherwise error code
; 1000 If invalid action defined
; 1001 If destination does not exist
;
;
;EXAMPLE $retcode=cleantempfiles('c:\temp','*.TMP',7)
;
;KIXTART BBS http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000103
;
CALL @ScriptDir\udf\DateMath.udf
CALL @ScriptDir\udf\DisplayText.udf
CALL @ScriptDir\udf\FullFile.udf
function cleantempfiles($action, $directories, optional $destination, $filter, $olderas)
Dim $retcode, $filetime, $timediff, $filename, $filefilter, $tempdir

if $action=2
if exist ($destination)=0
?"CHECK"
@ERROR=1001
goto ERCOND
endif
endif
$olderas=val($olderas)
if $olderas<0
$olderas=0
endif

if vartype($directories)<8192
dim $tmp[0]
$tmp[0]=$directories
$directories=$tmp
endif
if vartype($filter)<8192
dim $tmp[0]
$tmp[0]=$filter
$filter=$tmp
endif

for each $tempdir in $directories
if $tempdir<>'' and exist($tempdir)
for each $filefilter in $filter
if $VERBOSE
$retcode=displaytext('Filtering '+$tempdir+' for '+$filefilter)
endif
$filefilter=fullfile($tempdir,$filefilter)
$filename=dir($filefilter,1)
While $filename<>'' and @ERROR = 0
if $filename<>'.' and $filename<>'..'
$filename=fullfile($tempdir,$filename)
if exist($filename)
$filetime=left(getfiletime($filename),10)
$timediff=datemath(@DATE,$filetime)
if $VERBOSE
$retcode=displaytext('File '+$filename+' dated '+$filetime+' is '+$timediff+' days old')
endif
if $timediff>$olderas
if getfileattr($filename) & 16
$retcode=cleantempfiles($filename,$olderas)
$retcode=setfileattr($filename,128)
select
case $action = 1
;rd $filename
?"Removing directory: "+$filename
if $VERBOSE
$retcode=displaytext('Deleting obsolete directory '+$filename)
endif
case $action = 2
?"Moving directory: "+$filename
if $VERBOSE
$retcode=displaytext('Moving obsolete directory '+$filename)
endif
case 1
@ERROR=1000
GOTO ERCOND
endselect

if $VERBOSE
$retcode=displaytext('Deleting obsolete directory '+$filename)
endif
else
$retcode=setfileattr($filename,128)
select
case $action = 1
;del $filename
?"Removing file: "+$filename
if $VERBOSE
$retcode=displaytext('Deleting obsolete file '+$filename)
endif
case $action = 2
;copy "$filename", "$Destination"
?"Moving file: "+$filename
if $VERBOSE
$retcode=displaytext('Moving obsolete file '+$filename)
endif
case 1
@ERROR=1000
GOTO ERCOND

endselect
endif
endif
endif
endif
$filename=Dir('',1)
loop
next
endif
next
:ERCOND
$cleantempfiles=@ERROR
endfunction

_________________________
Austin Henderson