Added: Aug 19, 2002
Snippet uploaded by: snippet
Written By: Randy Birch
Demo: Sorry, no demo
Delete all Files in a directory (No Recursion)
Highlight all by clicking in box
' Another UseNet posting by Randy Birch
Public Type SHFILEOPSTRUCT
hWnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAborted As Boolean
hNameMaps As Long
sProgress As String
Public Const FO_DELETE = &H3
Public Const FOF_SILENT = &H4
Public Const FOF_RENAMEONCOLLISION = &H8
Public Const FOF_NOCONFIRMATION = &H10
Public Const FOF_SIMPLEPROGRESS = &H100
Public Const FOF_ALLOWUNDO = &H40
Public Const FOF_FILESONLY = &H80&
Private Sub Command1_Click()
'!!!! warning: this will delete all files in the path specified without
Dim sFiles As String
Dim SHFileOp As SHFILEOPSTRUCT
sFiles = "d:delete my contents*.*" & Chr$(0) & Chr$(0)
'set up the options
.wFunc = FO_DELETE
.pFrom = sFiles
.fFlags = FOF_FILESONLY Or _
FOF_SILENT Or _
FOF_NOCONFIRMATION Or _
'delete them files!
No Comments to show
Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.
Adding your comment. Please wait...
Thanks for adding your comment!. After further review it will be added.
There was a problem adding your comment. Please try again.
Please complete all the fields in the form before sending.