>Hi Larry,
>>
>>>> Does anyone know the command for finding out the total number of a directory ? Thanks.
>>>
>>>ADir() will work but Ed's enthusiasm has infected most of us. You could use the Scripting.FileSystemObject.
>>>
oFS = createobject("scripting.FileSystemObject")
>>>oFolder = oFS.GetFolder("\")
>>>return oFolder.Files.Count+oFolder.SubFolders.Count
>>>
>>>This will return the number of files and subdirectories in the specified directory.
>>
>>How can I find help about all properties and methods of scripting.FileSystemObject
>>
>>I used your program and it returns 9, 5 Files and 4 SubFolders. Now I'm trying to understand, which folder it used, how can I specify parameters, which folder to look and how can I print all file names in this directory and subfolders too.
>
>Ok, I can pass a parameter. Now I'm wondering, how can I count the number of files in all subfolders (not the number of subfolders). Right now it returns number of files in specified folder+ number of subfolders. If there a way to receive a number of all files in one command or I need to use
recursion and calculate by myself.
>
>TIA
Nadya,
Think of time needed to collect all that info. Recursion is one of the answers but it might be the trap too if not done correctly. If directory depth goes over allowed nested calls than you're likely to get an error with recursion. Better instead of checking all at once, look when needed. Also with FSO be carefull it accesses to special folders too. One of these special folders is important that you shouldn't further attempt to get subfolders ("System Volume Information"). What that directory is a mystery to me. For FSO reference and a sample code search jscript5.chm on your MSDN. Also do a search for FSO and you'd find some code using it the way you want (months ago so Jan 1,1999-Jul 1,1999 is a near bet:).
Cetin