Hi,
I want to know the date when is a file was created plus the size of the file.
Can somebody show me a vb code that handle this things. Thanks in advance.

Newvbguy

Recommended Answers

All 2 Replies

Let Me know if this works for ya

dim fso
dim f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile("C:\boot.ini")

CreatedDate = f.DateCreated
LastAccessed = f.DateLastAccessed
LastModified = f.DateLastModified
FileSize = f.Size

msgbox "Created Date: " & CreatedDate
msgbox "Last Access: " & LastAccessed
msgbox "Last Modified: " & LastModified
msgbox "File Size: " & FileSize

Hey Comatose,
Thanks again man. You're doing good.

Newvbguy

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.