Advertisement
ASP_Volume3 Files/ File Controls/ Input/ Output #48512

Recursive Deltree Sub

Deletes a specified directory tree.

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Public Sub KillFolderTree(sFolder As String)
 Dim sCurrFilename As String
 sCurrFilename = Dir(sFolder & "\*.*", vbDirectory)
 Do While sCurrFilename <> ""
 If sCurrFilename <> "." And sCurrFilename <> ".." Then
  If (GetAttr(sFolder & "\" & sCurrFilename) And vbDirectory) = vbDirectory Then
  Call KillFolderTree(sFolder & "\" & sCurrFilename)
  sCurrFilename = Dir(sFolder & "\*.*", vbDirectory)
  Else
  On Error Resume Next
  Kill sFolder & "\" & sCurrFilename
  On Error Goto 0
  sCurrFilename = Dir
  End If
 Else
  sCurrFilename = Dir
 End If
 Loop
 On Error Resume Next
 RmDir sFolder
End Sub
Original Comments (3)
Recovered from Wayback Machine