SHEmptyRecycleBin (shell32)
Last changed: -91.118.56.136

.
Summary

C# Signature:

[DllImport("shell32.dll")]
static extern int SHEmptyRecycleBin(IntPtr hWnd, string pszRootPath,
   uint dwFlags);

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

Here is a simple example of calling based on the above declaration. This will empty all recycle bins (rather than specifying one by including a path root in the pszRootPath parameter.

  public static void Empty()
{
    int hresult = SHEmptyRecycleBin(IntPtr.Zero, string.Empty, SHERB_NOCONFIRMATION | SHERB_NOPROGRESSUI | SHERB_NOSOUND);
    System.Diagnostics.Debug.Write(hresult);
}

Alternative Managed API:

Do you know one? Please contribute it!

Documentation