I have the following code:
VB Code:
Dim fs, f Set fs = CreateObject("Scripting.FileSystemObject") For i = 0 To CInt(NUMFOLDERS) While Dir(FARR(i) & "\*.BAK") <> "" filespec = Dir(FARR(i) & "\*.BAK") If filespec <> "" Then Set f = fs.GetFile(FARR(i) & "\" & filespec) mdate = f.DateLastModified If mdate < DateAdd("d", -14, Format(Now, "mm/dd/yyyy")) Then txtLog.Text = txtLog.Text & "delete: " & filespec & vbCrLf End If End If Wend Next
I'm just dumping the output to at textbox at the moment for testing, but the problem is that it never moves to the next file... it keeps running the same file in the while loop. Why doesn't it move to the next one?




Reply With Quote