|
-
Jun 25th, 2001, 02:53 AM
#4
kill or rmd
sir :
to tray the example
i have create dir. as temp & path as pass
in floppy disk
then
i have copyed the option in module as
Option Explicit
Private Type SHFILEOPSTRUCT
HWND As Long
WFUNC As Long
PFORM As String
PTO As String
FFLAGS As Integer
FABORTED As Boolean
HNAMEMAPS As Long
SPROGRESS As String
End Type
Private Const FOF_NOCOFIRMATION = &H10
Private Const FO_DELETE = &H3
Private Const FOF_ALLOWUNDO = &H40
Private Const FOF_FILESONLY = &H80
Private Declare Function SHFILEOPERATION Lib "SHELL32.DLL" Alias "SHFILEOPERATIONA" ()
Public Function NUKILL(PATH As String, Optional RECYCLE As Boolean = True) As Boolean
If Right(PATH, 1) = "\" Then PATH = Left(PATH, Len(PATH) - 1)
IF LEN (DIR$(PATH)<> 0 OR LEN(DIR$(PATH,VBDIRECTOE )) <> 0THEN
Dim SHFILEOP As SHFILEOPSTRUCT
With SHFILEOP
WFUNC = FO_DELETE
.PFORM = PATH
.FFLAGS = FOF_NOCONFIRMATION Or FOF_FILESONLY
If RECYCLE Then
.FFLAGS = .FFLAGS Or FOF_ALLOWUNDO
End With
NUKILL = (SHFILEOPERATION(SHFILEOP) = 0)
End If
End Function
'***********
then i have create button as
Private Sub Command1_Click()
MsgBox NUKILL("A:\TEMP\*", False)
End Sub
i have error msg , i know i have don something stupid
please sill need your help
thank you in advance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|