Hi,
Anyone know how to delete items from recycle bin?

please help.
Best regards.

Recommended Answers

you can use API file to do this.

Jump to Post

See if this helps :

Private Declare Function SHEmptyRecycleBin Lib "shell32.dll" Alias "SHEmptyRecycleBinA" (ByVal hwnd As Long, ByVal pszRootPath As String, ByVal dwFlags As Long) As Long
Dim RetVal As Long
Private Sub Command1_Click()
Dim y As Integer
   y = MsgBox("Are u sure to delete all items …
Jump to Post

All 5 Replies

you can use API file to do this.

how i can do this with api file?
i don't know about that..
can you help me sir?

Please help.
Best regards.

See if this helps :

Private Declare Function SHEmptyRecycleBin Lib "shell32.dll" Alias "SHEmptyRecycleBinA" (ByVal hwnd As Long, ByVal pszRootPath As String, ByVal dwFlags As Long) As Long
Dim RetVal As Long
Private Sub Command1_Click()
Dim y As Integer
   y = MsgBox("Are u sure to delete all items on Recycle Bin ? ", vbYesNo, "Confirmation")
   If y = vbYes Then
      RetVal = SHEmptyRecycleBin(0&, vbNullString, &H1)
   MsgBox "Recycle Bin has been cleaned"
   End If
End Sub
commented: Its Worked :) +2

Thank you very much sir.

It will empty the other stuff in the recycle bin but leave the icon like there is something there although when you open it up there is nothing in there. So, when I use the Disk Cleanup system tool, the recycle bin icon is empty, but when I navigate to it with PowerDesk (enhanced Windows Explorer utility), it shows that there is a folder in the recycle bin called "Dc2" and a file in that called "

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.