Results 1 to 5 of 5

Thread: Simple... get file date creation!

  1. #1

    Thread Starter
    Fanatic Member invitro's Avatar
    Join Date
    Jan 2000
    Location
    Outside your window
    Posts
    547

    Talking Getting the info of a file.. like when it was created.

    How can i get the date of when a file was modified?

    Thanks in advance!
    ok, so... windows takes 1 minute to search for a file on my PC yet google.com takes 1 second to search the entire internet?

  2. #2
    Guest
    Hi!

    The easiest way I know is to use the FileSystemObject.
    (You have to add 'Microsoft Scripting Runtime' to your references).
    Code:
    Dim fso As FileSystemObject
    Set fso = New FileSystemObject
        
    Dim fle As File
    Set fle = fso.GetFile("C:\Autoexec.bat")
        
    MsgBox "Modified: " & fle.DateLastModified
    _______________
    Regards
    da_bob

  3. #3
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Red face FileDateTime Function

    I think somebody have post the simple solution with create any Object like FileSystemObject.

    Code:
    Format(FileDateTime(<Your FileName>, "dd/mm/yyyy") & " " & Format(<Your FileName>), "h:mm:ss AMPM")

  4. #4

    Thread Starter
    Fanatic Member invitro's Avatar
    Join Date
    Jan 2000
    Location
    Outside your window
    Posts
    547

    Thumbs up

    Thanks for the reply, ill look into that right now!
    ok, so... windows takes 1 minute to search for a file on my PC yet google.com takes 1 second to search the entire internet?

  5. #5

    Thread Starter
    Fanatic Member invitro's Avatar
    Join Date
    Jan 2000
    Location
    Outside your window
    Posts
    547
    Code:
    TimeX = Format(FileDateTime(File), "dd/mm/yyyy") & " " & Format(FileDateTime(File), "h:mm:ss AMPM")
    Just a correction, this is how the code should look like.




    This format method works great, but it gives me the time the file was accessed not modified.

    Is there any way i can change that?

    [Edited by invitro on 06-21-2000 at 03:27 PM]
    ok, so... windows takes 1 minute to search for a file on my PC yet google.com takes 1 second to search the entire internet?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width