I haven't looked into the open cases and so this might be redundant, but it was fun, so...code:
break on
cls
; Date delete test
; Directory to look in.
$filename=dir("*.*")
"Please enter the date in the format YYYY/MM/DD"
? "Eg: 2000/05/10 - must have leading zeros : "
gets $date2
? "These are the files that are older than this $date2:"
while $filename<>"" and @error=0
if $filename="." $filename=dir() endif
if $filename=".." $filename=dir() endif
; get file time/date
$date=getfiletime("$filename")
$date=substr($date,1,10)
; Compare to $date2
if $date<$date2
? "$filename"
; del("$filename")
endif
; get next file
$filename=dir()
loop
Basically it will compare the user input date with the date on all the files in the specified directory and tell you which are older. I have commented out the DEL line.
Change the DIR at the top from *.* to a full path, ie C:\files\*.txt
Not a lot of error checking and I would leave the DEL commented the first time you use it.
cj