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
If it's not broken, fix it until it is.
My Blog