• Welcome to ForumKorner!
    Join today and become a part of the community.

[VB.NET] Empty Recycle Bin

CodeBreaker

Member
Reputation
0
[vb]Private Declare Function SHEmptyRecycleBin Lib "shell32.dll" Alias"SHEmptyRecycleBinA" (ByVal hWnd As Int32, ByVal pszRootPath As String,ByVal dwFlags As Int32) As Int32
Private Declare Function SHUpdateRecycleBinIcon Lib "shell32.dll" () As Int32

Private Const SHERB_NOCONFIRMATION = &H1
Private Const SHERB_NOPROGRESSUI = &H2
Private Const SHERB_NOSOUND = &H4

#Region "Empty Recycle Bin (SUB)"

Private Sub EmptyRecycleBin()
SHEmptyRecycleBin(Me.Handle.ToInt32, vbNullString, SHERB_NOCONFIRMATION + SHERB_NOSOUND)
SHUpdateRecycleBinIcon()
End Sub

#End Region[/vb]

To call it...

[vb]EmptyRecycleBin()[/vb]

Credits goes to Drakeâ„¢
 
Top