i know the api function for this but i didn't know how to use it.

SHEmptyRecycleBin

Anyone know how to use this api function to clean recycle bin???

Try This Following Code :

private declare function SHEmptyRecycleBin Lib "shell32.dll" Alias "SHEmptyRecycleBinA" (ByVal hwnd As Long,ByVal pszRootPath As String,ByVal dwFlags As Long) As Long
Private Const SHERB_NORMAL = &H10
Private Const SHERB_NOCONFIRMATION = &H1
Private Const SHERB_NOPROGRESSUI = &H2
Private Const SHERB_NOSOUND = &H4
Private Const SHERB_NOALL = _
(SHERB_NOCONFIRMATION And _
SHERB_NOPROGRESSUI And SHERB_NOSOUND)

Dim RetVal As Long
Private Sub Command1_Click()
   Dim y as Integer
   y = MsgBox("Are u sure to clean up Recycle Bin ? ", vbYesNo, "Confirmation"
   If y = vbYes Then
      RetVal = SHEmptyRecycleBin(0&,vbNullString,&H1)
   MsgBox "Recycle Bin has been cleaned"
   End If
End Sub

Ok. Hope This Helps.

Comments
Good
Great coding.....
Perfect :)

thx jx_man its working nice. :)
thanks Shouvik for your example program. :)

hi all..
how can i zip and unzip a file using SharpzipLib.Dll.
Can any one help me?.
Thanks in advance...

This question has already been answered. Start a new discussion instead.