'========================================================================== ' ' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 4.0 ' ' NAME: ' ' AUTHOR: Jeffery Hicks , JDH Information Technology Solutions ' DATE : 4/20/2006 ' ' COMMENT: ' '========================================================================== On Error Resume Next Dim objFSO,objFldr,objSubs,oIE strPath=InputBox("Enter in a directory path. Only the top level folder sizes will be calculated.","Directory Size Report","c:\") If strPath="" Then WScript.Quit 'quit if cancelled or nothing entered. 'add trailing \ If Right(strPath,1)<>"\" Then strPath=strPath & "\" End If Set oIE = CreateObject("InternetExplorer.Application") oIE.navigate "about:blank" oIE.ToolBar = False oIE.AddressBar = False oIE.Top = 10 oIE.Left = 10 oIE.Width = 700 oIE.Height = 600 oIE.Visible = True oIE.menubar = False oIE.StatusBar = True oIE.Document.writeln "Folder Size for " & strPath & "


" oIE.StatusText="Examining " & strPath Set objFSO=CreateObject("Scripting.FileSystemObject") set objFldr=objFSO.GetFolder(strPath) If Err.number<>0 Then oIE.Document.writeln "Failed to find " & strPath & "" WScript.Quit End If Set objSubs=objFldr.SubFolders oIE.Document.writeln "" For Each fldr In objSubs oIE.StatusText="Examining " & fldr.Name strSize=FormatNumber(Fldr.Size/1048576,2) 'Trace strPath & "\" & fldr.name & " " & strSize & " MB " & String(strSize/100,"|") oIE.Document.writeln "" Next oIE.Document.writeln "
" & fldr.name &_ " " & strSize &_ " MB
" oIE.Document.writeln "
Scale is one hash for every 25MB
" oIE.StatusBar=False Set oIE=Nothing WScript.Quit