Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get folder size 1

Status
Not open for further replies.

OrionCookies

Programmer
May 5, 2005
43
0
0
US
Hi,
I have script to get total size of the folder. it works fine if the size of folder is under 2G, but if over 2g, i am getting Overflow: 'of.size' error.

Here is my code.
'==============================================
dim FSO, objFolder,datafolder, foldername

foldername = "c:\Data"

Set fso= CreateObject("Scripting.FileSystemObject")

If fso.FolderExists(foldername ) Then
Set objFolder= FSO.GetFolder(foldername ) 'getting folder size objFolder.Size\par
ShowFolderDetails objFolder

Sub ShowFolderDetails(oF)
datafolder = oF.Size\1048576
end sub

wscript.echo datafolder
End If

'====================================================================

Please let me know any suggestion or help

thanks in advance
 
Code:
datafolder  = oF.Size [highlight]/[/highlight] 1048576
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top