Count files in a directory 
Author Message
 Count files in a directory

Can anybody help me, I need to write a small script that counts the number
of files in c:\test and returns a Msgbox  'There are # of files in c:\test"
Any help is most grateful.  Thanks.

-MF



Mon, 04 Feb 2002 03:00:00 GMT  
 Count files in a directory
I won't write the code for you, but I will point you where to look so
you can do it yourself.
http://msdn.microsoft.com/scripting/VBScript/doc/sgFSOSample.htm#CreateF
SO has a great example that uses pretty much every function of the FSO
model.  you will need to use the GetFolder method, and then use the
Count property of the Files collection.

Kirk Allen Evans



Quote:
> Can anybody help me, I need to write a small script that counts the
number
> of files in c:\test and returns a Msgbox  'There are # of files in
c:\test"
> Any help is most grateful.  Thanks.

> -MF

--
Kirk Allen Evans

(Do not send mail to the Deja News account used

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Mon, 04 Feb 2002 03:00:00 GMT  
 Count files in a directory
set fso = createobject("scripting.filesystemobject")
set folder = fso.getfolder("c:\test")
msgbox folder.files.count

--
Michael Harris


| Can anybody help me, I need to write a small script that counts the number
| of files in c:\test and returns a Msgbox  'There are # of files in
c:\test"
| Any help is most grateful.  Thanks.
|
| -MF
|
|



Mon, 04 Feb 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Counting Files in a Directory

2. code for counting files in a directory

3. code for counting files in a directory

4. Counting files in a directory???

5. Counting files in a Directory

6. HowTO : counting files in a directory using WinAPI ?

7. Counting files in a Directory

8. help: Counting how many files in directory

9. How to get file count in directory

10. Count all files in a directory tree

11. Count files in directory ?

12. Directory Count

 

 
Powered by phpBB® Forum Software