Results 1 to 4 of 4

Thread: [RESOLVED] Want to find installation location

  1. #1

    Thread Starter
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005

    Resolved [RESOLVED] Want to find installation location

    Hi all,

    I've installed Adobe acrobat in my system. my application will launch Acrobat using Shell command.
    VB Code:
    1. shell "C:\program files\Adobe\Acrobat\Acrobat.exe"
    I created a package of my application and installed on another system. In that system my application refused to open Acrobat. Since the acrobat is installed on different location. i.e., in my system it was installed in "C:\program files\". But In remote system it was installed in "F:\program files". How can I find the location where acrobat is installed through code. So that i can run my applcation on both the systems without any problems.

    Or is there any other way to get rid of this problem?

    Thanks in advance.

  2. #2
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    the Netherlands

    Re: Want to find installation location

    You can find the location in the registry at:

    What do you want to do after acrobat is open?
    If you want to open a pdf file, you can open the file with the ShellExecute API.
    ShellExecute opens a file with it's associated program, so you don't need to know where that program is located, or which program it is.
    There are plenty of examples on this forum about its usage.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Searching for mendhak

    Re: Want to find installation location

    You can also use this API to locate a file.
    VB Code:
    1. Option Explicit
    3. Private Declare Function SearchTreeForFile Lib "imagehlp" _
    4. (ByVal RootPath As String, ByVal InputPathName As String, _
    5. ByVal OutputPathBuffer As String) As Long
    7. Private Const MAX_PATH = 260
    9. Private Sub Command1_Click()
    10.     Dim tempStr As String, Ret As Long
    11.     'create a buffer string
    12.     tempStr = String(MAX_PATH, 0)
    13.     'returns 1 when successfull, 0 when failed
    14.     Ret = SearchTreeForFile("c:\", "Acrobat.exe", tempStr)
    15.     If Ret <> 0 Then
    16.         MsgBox "Located file at " + Left$(tempStr, InStr(1, tempStr, Chr$(0)) - 1)
    17.     Else
    18.         MsgBox "File not found!"
    19.     End If
    20. End Sub

  4. #4

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