Results 1 to 6 of 6

Thread: Automatically detection of install-directory

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2002
    Posts
    70

    Question Automatically detection of install-directory

    I am making a program with some statistics. One of them show you the last time you accessed the program. This is my code:
    ___________________________________________

    Dim FileSystemObject, FileObject As Object
    Set FileSystemObject = CreateObject("Scripting.FileSystemObject")
    Set FileObject = FileSystemObject.GetFile("C:\Program files\program.exe")
    Set FileSystemObject = CreateObject
    Text1.Text = vbCrLf & "Last accessed: " & _
    FileObject.DateLastAccessed & vbCrLf

    _____________________________________________

    The thing really, is that I have no guarantee for that the user will put the file in this directory. How do I make the program find the directory itself?

    Thank you!

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Automatically detection of install-directory

    Originally posted by Mutuz
    I am making a program with some statistics. One of them show you the last time you accessed the program. This is my code:
    ___________________________________________

    Dim FileSystemObject, FileObject As Object
    Set FileSystemObject = CreateObject("Scripting.FileSystemObject")
    Set FileObject = FileSystemObject.GetFile("C:\Program files\program.exe")
    Set FileSystemObject = CreateObject
    Text1.Text = vbCrLf & "Last accessed: " & _
    FileObject.DateLastAccessed & vbCrLf

    _____________________________________________

    The thing really, is that I have no guarantee for that the user will put the file in this directory. How do I make the program find the directory itself?

    Thank you!
    use app.path

    that will return the directory the exe is located in... but that only works in the exe itself... is this how you are doing it? because if it is.. then wouldn't the return value always be that day since they need to open the program to view the stat?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2002
    Posts
    70
    I get an error message, saying: "Run-time error '429': ActiveX component can`t create object."

  4. #4
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    Originally posted by Mutuz
    I get an error message, saying: "Run-time error '429': ActiveX component can`t create object."
    post the code..

  5. #5

  6. #6
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    what i don't get is... the value will always be the date/time that you opened the exe... so i don't understand the point i guess..

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