Discussion on:
View:
Show:
One consideration not addressed is speed. I had a small VB app which used FileSystemObject to loop through files in a folder. It took approx. 5-7 minutes just to walk through every file in a given folder (approx. 2200 files). When I switched to using the DIR() command, I could walk the files in about 6-10 seconds. There are limitations to DIR() as well, but the speed factor was a huge consideration which went against FileSystemObject.
Im not sure why pstarkey is experimenting speed problems, but I can tell you that I have a web page that populates 2 COMBO BOXES with the files of a certain directory (and I must have at least 800 files in there) and it does it in a second .Considering it is a WEB PAGE being processed trhough the server to the internet, I think that is a reasonable amount of time.
I think the speed problems you have dont have to do with the FileSystemObject, its probably some other operations you are doing.
Of course the DIR() command is going to work faster, if it only returns a string, while the FilesystemObject returns objects with properties, but the limitations (or better said, all the features that it does not have, since it has none) are terrible. Besides, nowadays, how often do you find folders with 2,000 files?
Just a thought...
I think the speed problems you have dont have to do with the FileSystemObject, its probably some other operations you are doing.
Of course the DIR() command is going to work faster, if it only returns a string, while the FilesystemObject returns objects with properties, but the limitations (or better said, all the features that it does not have, since it has none) are terrible. Besides, nowadays, how often do you find folders with 2,000 files?
Just a thought...
Sometimes you don't want all the overhead of an object. I was merely enumerating each file - not doing any action on the files at all - just looping through them to count them. And our document management server regularly puts 2000+ files in a folder. And we still have 650+ folders. Maybe it is only document management systems that store more than 800 files.
I'm newbie and I tried to use FileSystemObject but I got an error message saying User-defined type not defined
what would be the problem
what would be the problem
Hi!
To your VB project, add a reference to Microsoft Scripting Runtime (scrrun.dll).
This dll contains FileSystemObject.
Regards
Lars H.
To your VB project, add a reference to Microsoft Scripting Runtime (scrrun.dll).
This dll contains FileSystemObject.
Regards
Lars H.
It could not be declared in my code..
- Keyboard Shortcuts:
- Prev
- Next
- Toggle









































