Sub 按钮1_Click()
Dim i As Integer
i = 2
Set fso = CreateObject("Scripting.FileSystemObject")
Set fs = fso.getfolder(Sheet1.Cells(1, 2)).Files
With Sheet1
.Cells(i, 1) = "序号": .Cells(i, 2) = "创建时间": .Cells(i, 3) = "最后修改时间"
For Each f In fs
ex = Right(f, 4)
If ex = ".jpg" Or ex = ".bmp" Or ex = ".gif" Or ex = ".png" Or ex = ".tif" Then
i = i + 1
.Cells(i, 1) = f.Name: .Cells(i, 2) = f.datecreated: .Cells(i, 3) = f.DateLastModified
End If
Next
End With
End Sub
添加一个按钮,输入上面的代码,结果如下:
最简单的方式就是写一个脚本Java c 或者shell