使用API:SHEmptyRecycleBin(hWnd,lpszRootPath,dwFlags)函数
    

解决方案 »

  1.   

    代码:Const SHERB_NOCONFIRMATION = 1  'No dialog confirming the deletion of the objects will be displayed
    Const SHERB_NOPROGRESSUI = 2    'No dialog indicating the progress will be displayed
    Const SHERB_NOSOUND = 4         'No sound will be played when the operation is completePrivate Declare Function SHEmptyRecycleBin Lib "Shell32" Alias "SHEmptyRecycleBinA" _
        (ByVal HWND As Long, ByVal pszRootPath As String, ByVal dwFlags As Long) As LongPrivate Sub Command1_Click()
        SHEmptyRecycleBin Me.HWND, vbNullString, 0
    End Sub