BREAK ON;be sure to start the script in the root-directory wheer your sub-directories start
$dir1="\directory1"
$dir2="\directory2"
;etc..
SHELL '%comspec% /c dir /b $dir1 >> dir1.txt'
SHELL '%comspec% /c dir /b $dir2 >> dir2.txt'
OPEN (6,"dir1.txt")
$currentfile=READLINE(6)
DO WHILE ($currentfile<>"")
$monthover=0
$date_old=getfiletime("$currentfile")
$year_old=VAL(substr($date_old,1,4))
$month_old=VAL(substr($date_old,6,2))
$day_old=VAL(substr($date_old,9,2))
IF (VAL(substr(@date,1,4))-$year_old)>0 AND ($month_old<12) $monthover=1 GOTO decided ENDIF
IF (VAL(substr(@date,1,4))-$year_old)>0 AND ($month_old=12) AND (@monthno>1) $monthover=1 GOTO decided ENDIF
IF ((@monthno-$month_old)>1) $monthover=1 GOTO decided ENDIF
IF ((@monthno-$month_old)=1) $monthover=1 GOTO decided ENDIF
GOTO endloop
:decided
DEL "\$dir1\$currentfile"
:endloop
$currentfile=READLINE(6)
LOOP
CLOSE (6)
OPEN (7,"dir2.txt")
;etc..
I haven't any more time on my hands (my boss seems to think that my time is hers) - but preferrably: create an array for the directories so it'll be easier to add new ones in the future.. (also, it's an ugly loop at the moment but hasty scripting makes for crappy scripts - sorry) I'll see if I can get around to writing a better one tomorrow..
Or if you want, e-mail me the directory-structure and I'll see if I can make it work for you.
Fzz.