简体   繁体   中英

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). 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:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM