ChrisMo3142
Technical User
thread329-954944
Hi,
I used the script following script:-
=======================================
Dim oFS, oFolder
Dim objexcel, r, lnameArray, lname, nameLength
set oFS = WScript.CreateObject("Scripting.FileSystemObject")
set oFolder = oFS.GetFolder("\\BZN1\rootfs\mohammedc429\Group\EUNBZN\BZNMS007_501 Sqn")
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("\\BZN1\rootfs\mohammedc429\Personal\counts\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
============================================
What I was looking for is a way to adapt this to not only count all child-folders but, also to display each level depth in Excel.
E.g. if this path existed C:\test\test1\test2\test3\test4
I would like the results to be listed in columns listed by depth, level 1 has test, level 2 has test1 etc...
Any help is much appreciated!!
Chris.
Hi,
I used the script following script:-
=======================================
Dim oFS, oFolder
Dim objexcel, r, lnameArray, lname, nameLength
set oFS = WScript.CreateObject("Scripting.FileSystemObject")
set oFolder = oFS.GetFolder("\\BZN1\rootfs\mohammedc429\Group\EUNBZN\BZNMS007_501 Sqn")
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("\\BZN1\rootfs\mohammedc429\Personal\counts\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
============================================
What I was looking for is a way to adapt this to not only count all child-folders but, also to display each level depth in Excel.
E.g. if this path existed C:\test\test1\test2\test3\test4
I would like the results to be listed in columns listed by depth, level 1 has test, level 2 has test1 etc...
Any help is much appreciated!!
Chris.