Windows 7: How to display the total size of Recycle Bin
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.
Solution 1:
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
Solution 2:
Sort the Recycle Bin by Item Type, then select all the files, do not select any directories. At the bottom you will be able to see the size of all the files if you show detailed information.
An alternative way is to select all the hidden system folders called $Recycle.bin in the System Root and viewing the details or properties of your selection, but above method should just do...
DIR /S %SYSTEMDRIVE%\$RECYCLE.BIN | FINDSTR /C:File(s)
See the last entry of above command to get the size of the recycle bin from a command prompt.
I wonder why it's important to know the size of the recycle bin though, when you want to know how much space you earn it's better to use Disk Cleanup or a similar tool, but for just getting rid of your deleted items it is not necessary. I think they left that feature out because it would have to look at different recycle bins, but indeed, with an extra effort it wouldn't be hard to implement...
Solution 3:
It would have been good if Microsoft would save us people trouble to go to all these lengths and just implement the functionality the XP recycle bin had. Too bad.
The easiest solution I could find is the following:
- In Folder Options, turn on the display of hidden files and folders as well as protected operating system files.
- Browse to your C: drive, open the
$Recycle.Bin
folder, and then right-click and choose properties of the Recycle Bin icon you see.
This will show the total size.