954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

File Attributes

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

NewVBguy
Junior Poster in Training
71 posts since Mar 2005
Reputation Points: 13
Solved Threads: 3
 

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
Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

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

Newvbguy

NewVBguy
Junior Poster in Training
71 posts since Mar 2005
Reputation Points: 13
Solved Threads: 3
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You