Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: dirsize
Size 3,375,239,227 Size on Disk 3,802,210,304 DirSize(directory,0,1) is 3,364,075,348 -- should match explorer's size(?) DirSize(directory,1,1) is 3,790,237,696 -- should match explorer's size on disk(?)Any thoughts on why DirSize isn't matching? I'm in Windows XP 32bit, SP3 with all current patches (I hope).
If it makes any difference, there are no junctions or links. There are 167,621 files and 11,497 directories.
Does this code match what you see in the Windows Explorer?
#DefineFunction udfShellDirSize( directory ) objFSO = CreateObject("Scripting.FileSystemObject") objFolder = objFSO.GetFolder( directory ) If objFolder != 0 size = objFolder.Size Else Return -1 ;Error: Folder doesnt exist EndIf objFolder = 0 objFSO = 0 Return size #EndFunction directory = DirWindows(1) ret = udfShellDirSize( directory ) Pause( directory, ret )
Here's some information on the DirSize(1) anomalies:
Disk="C" spc = DiskInfo(disk, 1) bps = DiskInfo(disk, 2) bpc = spc * bps Message("Cluster size on drive C:", bpc)You'll notice that the results from DiskInfo give too large a cluster size for the Fat32 drive. 32768 for a little 3 GB drive; accurate for Fat16.
MB1=a / (1000*1000) MB2=a / (1000*1024) MB3=a / (1024*1024) answers=strcat("MB1=",mb1,@crlf,"MB2=",mb2,@crlf,mb3) Message("Answers",answers)
Article ID: W13051
Filename: DirSize Function Anomalies.txt
File Created: 2010:04:28:11:36:58
Last Updated: 2010:04:28:11:36:58