Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Delete a Directory
Author:
Daniel M. Ionescu
E-mail:
Click to e-mail author
Submitted:
2/9/2004
Version:
VB6
Compatibility:
VB6
Category:
File Manipulation
Views:
16939
A very simple procedure to delete a directory and the entire subdirectory structure.
Declarations:
Dim tempor As String, pos As Integer
Code:
Sub DelFiles(path As String) 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
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement