Results 1 to 3 of 3

Thread: Last Modified

  1. #1

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    Post

    I have a folder "Myfolder" and in it I have multiple files, say 10 for arguments sake.
    Is there a function which will tell me last date modified...I am running a job which should change data in all files of MyFolder...sometimes it doesn't..

    So I need to read the last date modified of all files in Myfolder and then send a message if one of the 10 doesn't have a modified date to match todays date.
    Thanks,
    Wayne

  2. #2
    New Member
    Join Date
    Dec 1999
    Location
    Bethlehem, PA US
    Posts
    10

    Post

    here is a rounting using a filesystem object that is an easy way to get the timestamp. This uses the scrrun.dll if you are distributing this code to others in your program.

    Sub ShowFileInfo(filespec)
    Dim fs, f, s
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFile(filespec)
    s = "Created: " & f.DateCreated
    MsgBox s
    End Sub


  3. #3
    New Member
    Join Date
    Dec 1999
    Location
    Bethlehem, PA US
    Posts
    10

    Post

    ....there is alsow a DateLastModified property on this object that is probably closer to what you are looking for

    Sub ShowFileAccessInfo(filespec)
    Dim fs, f, s
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFile(filespec)
    s = UCase(filespec) & vbCrLf
    s = s & "Created: " & f.DateCreated & vbCrLf
    s = s & "Last Accessed: " & f.DateLastAccessed & vbCrLf
    s = s & "Last Modified: " & f.DateLastModified
    MsgBox s, 0, "File Access Info"
    End Sub


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