Expand Minimize
5 out of 5 rated this helpful - Rate this topic

SHEmptyRecycleBin function

Empties the Recycle Bin on the specified drive.

Syntax


HRESULT SHEmptyRecycleBin(
  _In_opt_  HWND hwnd,
  _In_opt_  LPCTSTR pszRootPath,
  DWORD dwFlags
);

Parameters

hwnd [in, optional]

Type: HWND

A handle to the parent window of any dialog boxes that might be displayed during the operation. This parameter can be NULL.

pszRootPath [in, optional]

Type: LPCTSTR

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 NULL. If this value is an empty string or NULL, all Recycle Bins on all drives will be emptied.

dwFlags

Type: DWORD

One or more of the following values.

SHERB_NOCONFIRMATION

No dialog box confirming the deletion of the objects will be displayed.

SHERB_NOPROGRESSUI

No dialog box indicating the progress will be displayed.

SHERB_NOSOUND

No sound will be played when the operation is complete.

Return value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

Minimum supported client

Windows 2000 Professional, Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Shellapi.h

Library

Shell32.lib

DLL

Shell32.dll (version 4.71 or later)

Unicode and ANSI names

SHEmptyRecycleBinW (Unicode) and SHEmptyRecycleBinA (ANSI)

See also

SHQueryRecycleBin

 

 

Send comments about this topic to Microsoft

Build date: 11/28/2012

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.