Hi bashless,
put the code in a form:
Public Enum EFileAttributes
faArchive = &H20&
faCompressed = &H800&
faDirectory = &H10&
faHidden = &H2&
faNormal = &H80&
faReadOnly = &H1&
faSystem = &H4&
faTemporary = &H100&
End Enum
Public Enum EFileAccessModes
famQuery = 0&
famGenericRead = &H80000000
famGenericWrite = &H40000000
famGenericExecute = &H20000000
famGenericAll = &H10000000
End Enum
Public Enum EFileShareModes
fsmShareNone = 0&
fsmShareRead = 1&
fsmShareWrite = 2&
fsmShareDelete = 4&
End Enum
Public Enum EFileCreationMode
fcmCreateNew = 1&
fcmCreateAlways = 2&
fcmOpenExisting = 3&
fcmOpenAlways = 4&
fcmTruncateExisting = 5&
End Enum
Private Type TFileTime
dwLowDateTime As Long
dwHighDateTime As Long
End Type
Private Type TSystemTime
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, lpSecurityAttributes As Any, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function GetFileTime Lib "kernel32" (ByVal hFile As Long, lpCreationTime As TFileTime, lpLastAccessTime As TFileTime, lpLastWriteTime As TFileTime) As Long
Private Declare Function FileTimeToSystemTime Lib "kernel32" (lpFileTime As TFileTime, lpSystemTime As TSystemTime) As Long
Private Sub Form_Load()
Dim FileName As String
Dim hFile As Long
Dim ftFileCreation As TFileTime
Dim ftFileLastAccess As TFileTime
Dim ftFileLastWrite As TFileTime
Dim stFileCreation As TSystemTime
Dim stFileLastAccess As TSystemTime
Dim stFileLastWrite As TSystemTime
FileName = "c:\autoexec.bat"
hFile = CreateFile(FileName, famGenericRead, fsmShareRead, ByVal 0&, fcmOpenExisting, faNormal, 0&)
If hFile = -1 Then Exit Sub
GetFileTime hFile, ftFileCreation, ftFileLastAccess, ftFileLastWrite
CloseHandle hFile
FileTimeToSystemTime ftFileCreation, stFileCreation
FileTimeToSystemTime ftFileLastAccess, stFileLastAccess
FileTimeToSystemTime ftFileLastWrite, stFileLastWrite
With stFileCreation
Debug.Print "FileCreation:" & Format(.wDay & "." & .wMonth & "." & .wYear & " " & .wHour & ":" & .wMinute & ":" & .wSecond, "dd.mm.yyyy hh:nn:ss"

End With
With stFileLastAccess
Debug.Print "FileLastAccess:" & Format(.wDay & "." & .wMonth & "." & .wYear & " " & .wHour & ":" & .wMinute & ":" & .wSecond, "dd.mm.yyyy hh:nn:ss"

End With
With stFileLastWrite
Debug.Print "FileLastWrite:" & Format(.wDay & "." & .wMonth & "." & .wYear & " " & .wHour & ":" & .wMinute & ":" & .wSecond, "dd.mm.yyyy hh:nn:ss"

End With
End Sub
Bye
LauDse