DelFiles

A very simple to delete a directory and the entire files and folders in its subdirectory structure (Tree).
It uses Dir object,

CodeFunctionName
What is this?

Public

Not Tested

Imported
Dim tempor As String, pos As Integer ' declarations
' function
Sub DelFiles(path)
pos = 0
tempor = Dir(path + "\*.*", 22)
Do While tempor < > ""
If tempor < > "." And tempor < > ".." Then
If (GetAttr(path + "\" + tempor) And 16) = 0 Then
SetAttr path + "\" + tempor, 0
Kill path + "\" + tempor
Else
DelFiles (path + "\" + tempor)
tempor = Dir(path + "\*.*", 22)
End If
End If
tempor = Dir
Loop
RmDir path
End Sub

path

Views 1,197

Downloads 468

CodeID
DB ID

ANmarAmdeen
610
Attachments
Revisions

v1.0

Wednesday
April
1
2020