Eu me deparei com isso também.
A resposta aceita não satisfez minhas necessidades. Eu queria saber o tamanho de todas as lixeiras e o total delas.
Usando o provedor WMI, é fácil fazer isso: (salve como um arquivo .vbs)
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
Wscript.Echo ret & "---------" & vbCr & "Total: " & calcSize(fileSizeTotal)
Next
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
ou faça o download a partir daqui: link
editar: Eu atualizei o script para que ele não trave se a partição não tiver lixeira. Os bytes também são exibidos corretamente