number of folders

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
demac43
Newbie
Posts: 7
Joined: Wed Mar 09, 2005 9:58 pm
Location: Australia

number of folders

Post by demac43 » Mon Mar 21, 2005 7:20 pm

I am needing to know the number of folders in a directory, as opposed to the number of files in that directory (using 'Countfiles').

I am using a script upon 'Total Commander' file manager, and need to know if a folder which i have copied contains other folders or just files as i need to work with the files within.

Is there any command to make this easier, or must i write a script to calculate this for myself.

regards demac

:?:

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Mon Mar 21, 2005 8:50 pm

Here:

VBSTART
Function NumFolders(Path)
set objFS = CreateObject("Scripting.FileSystemObject")
set objFolder = objFS.GetFolder(Path)
NumFolders = objFolder.SubFolders.Count
End Function
VBEND
VBEval>NumFolders("c:\windows"),NumFldrs
MessageModal>Folders in Windows Dir: %NumFldrs%
MJT Net Support
[email protected]

demac43
Newbie
Posts: 7
Joined: Wed Mar 09, 2005 9:58 pm
Location: Australia

ok

Post by demac43 » Mon Mar 21, 2005 9:27 pm

thanks for the info

regards demac

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts