We’re using folder = objFSO.GetFolder(<path>) to get a list of files with a directory.
We then For Each over the folder.Files array to output the list of filenames.
We’ve got to a point where there are thousands of files in the folder and its quite slow so we want to add some pagination to the screen. So to all show 500 files at a time. I have no idea if this is even possible and all Google searches haven’t helped.
Could anyone point me in the right direction?
Firstly, regarding the listing of the files, can you get the listing and persist (cache) the result somewhere to speed up repeated access? This is a method we use in .NET when getting large listings of files (we’re using ASP.NET Web Pages so we just use WebCache.Set, but I imagine you could write it to a text file if you needed to).
I see some anecdotal evidence here that FSO is quite slow when listing large numbers of files:
Obviously once you have the listing you would loop through them 500 at a time with an offset / page size
EDIT: I include an example on how to use WScript.Shell to do this from a couple of aspfaq.com articles I found (1 | 2)