Results 1 to 3 of 3

Thread: Problems getting File Times in Windows 2000

  1. #1

    Thread Starter
    Addicted Member VB6Coder's Avatar
    Join Date
    Apr 2001
    Location
    Northampton, UK
    Posts
    185

    Question Problems getting File Times in Windows 2000

    I'm trying to get the Created, Modified and Accessed times of a file in Windows 2000. I found an example on the www.vbapi.com website (http://www.vbapi.com/ref/g/getfiletime.html) showing me how to get the File Time using the GetFileTime API.

    The problem is I keep getting -1 returned when I use the CreateFile API in Windows 2000, but it works fine in Windows 95.

    I've tried using the OpenFile API instead of the CreateFile API. The problem is it makes the GetFileTime API return a more recent date, than the date displayed in the File Properties dialog.


    Help



    Thanks in advance.

  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    I used the FindFirstFile function on Win2000 to get the FILETIME and it seems to work ok.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  3. #3

    Thread Starter
    Addicted Member VB6Coder's Avatar
    Join Date
    Apr 2001
    Location
    Northampton, UK
    Posts
    185

    Thumbs up

    Cheers Josh, I'll have a play with the FindFirstFile API.

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