Windows 7: How to display the total size of Recycle Bin

recycle-binwindows 7

On Windows XP, the total size of Recycle Bin could be seen easily, but I can't see it on Windows 7. Why did Microsoft hide/remove this feature? Am I missing something?

REMARK 1: I don't need to see the maximum size that Recyle Bin can contain.

REMARK 2: Once you have several files selected in the Recycle Bin, you get a "See more details" link in the status bar, but clicking on that does not display the total file size. Microsoft has apparently changed this.

Best Answer

I ran into this as wel.

The accepted answer didn't satisfy my needs. I wanted to know the size of all the recycle bins as well as the total of these.

Using the WMI provider, it is easy to accomplish this: (save as a .vbs file)

dim oFS, oFolder, fileSizeTotal
Dim objWMIService, objItem, colItems, colPartitions, objPartition, _
    objLogicalDisk, colLogicalDisks
Dim strComputer, strMessage, strPartInfo,strDeviceID,ret
set oFS = WScript.CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject( "WScript.Shell" )


strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_DiskDrive")
For Each objItem in colItems
    strDeviceID = Replace(objItem.DeviceID, "\", "\\")
    Set colPartitions = objWMIService.ExecQuery _
        ("ASSOCIATORS OF {Win32_DiskDrive.DeviceID=""" & strDeviceID & _
        """} WHERE AssocClass = Win32_DiskDriveToDiskPartition")
    For Each objPartition In colPartitions
        Set colLogicalDisks = objWMIService.ExecQuery _
            ("ASSOCIATORS OF {Win32_DiskPartition.DeviceID=""" & _
            objPartition.DeviceID & _
            """} WHERE AssocClass = Win32_LogicalDiskToPartition")
        strPartInfo = strPartInfo & "Disk Partition: " & objPartition.DeviceID
        For Each objLogicalDisk In colLogicalDisks
            strPartInfo = strPartInfo & " " & objLogicalDisk.DeviceID
            ret = ret & objLogicalDisk.DeviceID & "\"
            if oFS.FolderExists(objLogicalDisk.DeviceID&"\$Recycle.Bin") then
                RECpath=oShell.ExpandEnvironmentStrings( _
                objLogicalDisk.DeviceID & "\$Recycle.Bin")
                set oFolder = oFS.GetFolder(RECpath)
                ShowFolderDetails(oFolder)
            else
                ret = ret & " -empty- " & vbCr
            end if
        Next
        strPartInfo = strPartInfo & vbCr
    Next
Next
Wscript.Echo ret & "---------" & vbCr & "Total: " & calcSize(fileSizeTotal)
WSCript.Quit


Sub ShowFolderDetails(oF)
    Dim size
    fileSizeTotal = fileSizeTotal + oF.Size
    size = calcSize(oF.Size)
    ret = ret & " = " & size  & vbCr
end Sub

function calcSize(sizeInB)
    Dim fSize, iKB, iMB, iGB, d
    iKB = 1024
    iMB = iKB * 1024
    iGB = iMB * 1024
    d = 2
    if sizeInB >= iGB then
        fSize = round(sizeInB/iGB,d) & " GB"
    elseif sizeInB >= iMB then
        fSize = round(sizeInB/iMB,d) & " MB"
    elseif sizeInB >= iKB then
        fSize = round(sizeInB/iKB,d) & " KB"
    else
        fSize = sizeInB & " B"
    end if
    calcSize = fSize
end function

edit: I updated the script so it will not crash if the partition has no recycle bin. Also Bytes are now shown correctly