Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleEmpty the wastebasket
Keywordswastebasket, recycle bin, empty, delete
CategoriesFiles and Directories, Utilities
 
By Will Swift.

 
Private Sub ClearRecycleBin(Optional ByVal RootPath As _
    String, Optional ByVal hwndParent As Long, Optional _
    ByVal NoConfirmation As Boolean, Optional ByVal _
    NoProgress As Boolean, Optional ByVal NoSound As _
    Boolean)
Dim nOptions As Long
Const SHERB_NOCONFIRMATION = &H1
Const SHERB_NOPROGRESSUI = &H2
Const SHERB_NOSOUND = &H4

    If NoConfirmation Then nOptions = SHERB_NOCONFIRMATION
    If NoProgress Then nOptions = nOptions Or _
        SHERB_NOPROGRESSUI
    If NoSound Then nOptions = nOptions Or SHERB_NOSOUND

    On Error Resume Next
    SHEmptyRecycleBin hwndParent, RootPath, nOptions
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated