Get creation date of multiple files in vb
I'm trying to pull the creation date of all the files (1000+) in a folder on a local server to list in an excel file. I've been trying to use FileSystemInfo for this, but it doesn't seem to work to get the creation date of MULTIPLE files because it doesn't allow me to use wildcard characters to read all (not even sure if that's what I'll need to do开发者_Go百科). Has anyone ever done this?
This should help you loop through all of the files:
Dim dirinfo As New DirectoryInfo("C:\somefolder")
For Each fsi As FileSystemInfo In dirinfo.GetFileSystemInfos()
debug.print(fsi.CreationTime)
Next
Some things to read up on:
- For loops
- FileSystemInfo Class
- DirectoryInfo Class
精彩评论