|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
The scenario is that I have these folders:
D:\Backup Backup\01\ Backup\02\ Backup\03\ I wanted to count the quantity of subfolders under D:\Backup, is this possible? |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
M P wrote:
> The scenario is that I have these folders: > > D:\Backup > Backup\01\ > Backup\02\ > Backup\03\ > > I wanted to count the quantity of subfolders under D:\Backup, is this > possible? > On method would be to use the Count property of the SubFolders method of the folder object. For example: ========= Option Explicit Dim objFSO, objFolder Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder("d:\backup") Wscript.Echo "Number of sub folders: " & objFolder.SubFolders.Count ========= This would only count direct children of the folder, not children of the children. -- Richard Mueller Microsoft MVP Scripting and ADSI Hilltop Lab - http://www.rlmueller.net -- |
|
![]() |
| Outils de la discussion | |
|
|