Shell32EmptyRecycleBin(IntPtr, String, SHEmptyRecycleBinFlags) Method

Empties the Recycle Bin on the specified drive.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Shell32.dll", EntryPoint = "SHEmptyRecycleBin", 
	CharSet = CharSet.Unicode)]
public static bool EmptyRecycleBin(
	IntPtr hWnd = default,
	string rootPath = "",
	SHEmptyRecycleBinFlags flags = 
)

Parameters

hWnd  IntPtr  (Optional)
A handle to the parent window of any dialog boxes that might be displayed during the operation.

This parameter can be .

rootPath  String  (Optional)
The address of a null-terminated string of maximum length MAX_PATH that contains the path of the root drive on which the Recycle Bin is located.

This parameter can contain the address of a string formatted with the drive, folder, and subfolder names, for example 'C:\windows\system\'.

It can also contain an empty string or .

If this value is an empty string or , all Recycle Bins on all drives will be emptied.

flags  SHEmptyRecycleBinFlags  (Optional)
Specifies the Recycle bin behavior, this parameter can be one or more flags.

Return Value

Boolean
if operation succeeds, otherwise.

Remarks

See Also