• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 168
  • Last Modified:

detect the start time of exe file opened

how i can detect the start time and full path name of a exe file that is being opened and write it into a log file?
0
fanghua
Asked:
fanghua
1 Solution
 
paul_tsekovCommented:
 Do you start your EXE from Visual Basic with the function Shell "MyFile.EXE" for example,
  or you want to detect some out of Visual Basic started EXE?
0
 
billy_98_1Commented:
for the start time you can just use the system variable Time. I'm not sure if it is a string or an integer though becasue I can't remember.
I can't help with the path name though.
0
 
danelroismanCommented:
The GetFileInformationByHandle function retrieves information about a specified file.

Public Type BY_HANDLE_FILE_INFORMATION
        dwFileAttributes As Long
        ftCreationTime As FILETIME
        ftLastAccessTime As FILETIME
        ftLastWriteTime As FILETIME
        dwVolumeSerialNumber As Long
        nFileSizeHigh As Long
        nFileSizeLow As Long
        nNumberOfLinks As Long
        nFileIndexHigh As Long
        nFileIndexLow As Long
End Type


Public Declare Function GetFileInformationByHandle Lib "kernel32" Alias "GetFileInformationByHandle" (ByVal hFile As Long, lpFileInformation As BY_HANDLE_FILE_INFORMATION) As Long
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now