logicacmg000
Technical User
On a server there are 60GB of data and I want to check under each sub-folder what files there are and their sizes. What is the best and easiest way to do this on W2k3.
Thanks.
Thanks.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
'==========================================================================
'
' NAME: <filename>
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: [URL unfurl="true"]http://www.thespidersparlor.com[/URL]
' DATE : 12/23/2003
'
' COMMENT: <comment>
'
'==========================================================================
'Check all subfolders below given folder for size over a minimum size.
Dim FolderPath
Dim FolderSize
Dim MinSize
Set objArgs=WScript.Arguments
FolderPath=objArgs(0)
MinSize=CLng(objArgs(1))
Const CONVERSION_FACTOR = 1048576 'converts folder size to MB
'Const MinSize = 100 'set minimum folder size in MB.
If Wscript.Arguments.count = 0 Then
Wscript.Echo "Usage: foldersize.vbs [folder][minimum size]"
Wscript.Echo "Example: foldersize.vbs c:\myfolder 50"
Wscript.Quit
End If
'FolderPath = Wscript.Arguments(0)
'MinSize = Wscript.Arguments(1)
report = "Folder Size" & vbTab &"Folder Name" & vbCrLf
Set FSO = CreateObject ("Scripting.FileSystemObject")
ShowSubFolders FSO.GetFolder(FolderPath)
MsgBox Report
Sub ShowSubFolders (Folder)
For Each SubFolder In Folder.SubFolders
FolderSize = SubFolder.Size / CONVERSION_FACTOR
If FolderSize > MinSize Then
report = report & int(FolderSize) & vbTab & vbTab & SubFolder.Path & vbCrLf
End If
ShowSubFolders SubFolder
Next
End Sub
'==========================================================================
'
' NAME: getFolderSizes2XL.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: [URL unfurl="true"]http://www.thespidersparlor.com[/URL]
' DATE : 11/21/2004
'
' COMMENT: <comment>
'
'==========================================================================
Dim oFS, oFolder
Dim objexcel, r, lnameArray, lname, nameLength
set oFS = WScript.CreateObject("Scripting.FileSystemObject")
set oFolder = oFS.GetFolder("C:\Documents and Settings")
Set objExcel = createobject("Excel.application")
objexcel.Workbooks.add
objexcel.Cells(1, 1).Value = "Folder Name"
objexcel.Cells(1, 2).Value = "Size (MB)"
objexcel.Cells(1, 3).Value = "# Files"
objexcel.Cells(1, 4).Value = "# Sub Folders"
objexcel.Visible = True
Wscript.Sleep 300
r=2
ShowFolderDetails oFolder, r
' objexcel.ActiveWorkbook.SaveAs("LogonReport.xls")
' objexcel.Quit
MsgBox "Done"
Function ShowFolderDetails(oF,r)
Dim F
objexcel.Cells(r, 1).Value = oF.Name
objexcel.Cells(r, 2).Value = oF.Size /1024\1024
objexcel.Cells(r, 3).Value = oF.Files.Count
objexcel.Cells(r, 4).Value = oF.Subfolders.count
r = r+1
for each F in oF.Subfolders
ShowFolderDetails F, r
next
End Function