I ended-up writting a VB program to delete the files. If anyone is interested, the source code follows:<br>
<br>
<br>
Private Sub Main()<br>
<br>
' This program will delete old files from the current directory.<br>
' It accepts an argument that determines how old the files should be before they are<br>
' deleted.<br>
' To use the program, first create a text file of the current directory be entering:<br>
' dir > dir.txt<br>
' This program reads the dir.txt file and parses out the file names.<br>
' The file date from the dir command is used to calcualte the age of the file.<br>
' Files older than the 'day' argument will be deleted.<br>
<br>
Dim i As Integer, intRecCnt As Integer, intDays As Integer<br>
Dim intStartPosition As Integer, intEndOfRecordPosition As Integer, intArgDays As Integer<br>
Dim strDOSFilename As String, strFileName As String<br>
Dim strFileList(2000) As String, strTempFile As String<br>
Dim dFileDate As Date, dCurrDate As Date<br>
Dim strArgs As String, strMsg As String<br>
<br>
' get the command line argument(s)...<br>
strArgs = Command<br>
<br>
' strFileName is used to determine if the file exists<br>
strDOSFilename = "dir.txt"<br>
strFileName = Dir(strDOSFilename)<br>
<br>
' perform edits...<br>
If strArgs = "" _<br>
Or strFileName = "" Then<br>
strMsg = "This progam deletes files from the current directory that are" & vbCrLf & _<br>
"greater than n days old." & vbCrLf & vbCrLf & _<br>
"To use it, create a text file of file names by entering the following DOS command:" & vbCrLf & vbCrLf & _<br>
"dir > dir.txt" & vbCrLf & vbCrLf & _<br>
"Then, execute this program passing the number of days. For example," & vbCrLf & _<br>
"to delete files older than 45 days, enter:" & vbCrLf & vbCrLf & _<br>
"DeleteOldFiles 45"<br>
MsgBox strMsg<br>
Exit Sub<br>
End If<br>
<br>
If IsNumeric(strArgs) Then<br>
intArgDays = strArgs<br>
Else<br>
MsgBox "Invalid 'number of days' argument passed" & vbCrLf & vbCrLf & strArgs<br>
Exit Sub<br>
End If<br>
<br>
<br>
' now, continue processing...<br>
<br>
On Error Resume Next<br>
Open strDOSFilename For Input Access Read As #1<br>
If Err Then<br>
MsgBox "Can't open file: " & strDOSFilename<br>
Exit Sub<br>
End If<br>
<br>
'Read the whole file into a single string<br>
strTempFile = Input$(LOF(1), #1)<br>
Close #1<br>
<br>
' Parse the file-string into individual records and put results into an array<br>
' by finding the CRLF characters<br>
<br>
intRecCnt = 0<br>
intStartPosition = 1<br>
intEndOfRecordPosition = InStr(intStartPosition, strTempFile, Chr$(13)) 'CR = 13<br>
While intEndOfRecordPosition >= intStartPosition<br>
intRecCnt = intRecCnt + 1<br>
<br>
strFileList(intRecCnt) = _<br>
Mid$(strTempFile, intStartPosition, intEndOfRecordPosition - intStartPosition) + Chr$(0)<br>
<br>
intStartPosition = intEndOfRecordPosition + 2<br>
intEndOfRecordPosition = InStr(intStartPosition, strTempFile, Chr$(13))<br>
Wend<br>
<br>
dCurrDate = Date<br>
<br>
' identify the records that have file names, exclude directories, check the days, & delete<br>
For i = 1 To intRecCnt<br>
<br>
' records with file names have a date on the left, identify the date by looking for the slash;<br>
' exclude directories<br>
If Mid(strFileList(i), 3, 1) = "/" _<br>
And Not Mid(strFileList(i), 26, 3) = "DIR" Then<br>
<br>
' convert the text date into a date variable<br>
dFileDate = Format(Left(strFileList(i), 8), "MM/DD/YY")<br>
<br>
' calculate the age of the file<br>
intDays = DateDiff("d", dFileDate, dCurrDate)<br>
<br>
' if the number of days exceedes the passed number of days, delete the file<br>
If intDays > intArgDays Then<br>
<br>
' delete the file<br>
Kill (Right(strFileList(i), Len(strFileList(i)) - 39)) ' file name is at the end of the record<br>
<br>
End If<br>
End If<br>
Next i<br>
End Sub<br>
<br>