Results 1 to 5 of 5

Thread: look for executible

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2000
    Location
    W.Lafayette, In USA
    Posts
    37
    I am trying to search to see if a computer has AcroRd32.exe(the acrobat reader) installed on their computer. Can any of you give me some sample code to check if a computer has the reader on it? Thanks!!

  2. #2
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    London
    Posts
    290
    If you know where the file is you could try and open the file. If the open fails, its not there.
    You dont want to search the entire harddrive(s) though.
    Maybe theres a better way? Perhaps a registry entry you could check?

    Alex.

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2000
    Location
    W.Lafayette, In USA
    Posts
    37
    Well what happens when I don't know where the file is?

  4. #4
    Junior Member
    Join Date
    Feb 2000
    Posts
    19
    Jay=B is right.
    He's trying to search for specific file.
    If you check in Registry it is not a comment idea.
    What happen if the registry file exist data about Acrobat.
    But the AcroRd32.exe and its set had been delete without uninstall.

    So Jay=B I think you should do a little search in vb Forum.
    There is a Tip about Seaching entire HD.

    good luck

  5. #5
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    Try something like this:
    Code:
    Private Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory As String, ByVal lpResult As String) As Long
    
    Private Sub Command1_Click()
        Dim sEXE As String
        'Create an empty file with the Acrobat Extension
        Open "C:\test.pdf" For Output As 1
        Close 1
        'Find the path to the Program associated with PDF's
        sEXE = Space(255)
        Call FindExecutable("C:\Test.pdf", "", sEXE)
        If InStr(sEXE, Chr(0)) Then sEXE = Left$(sEXE, InStr(sEXE, Chr(0)) - 1)
        If Len(sEXE) Then
            'If an EXE was found check it still exists
            If Len(Dir(sEXE)) Then
                MsgBox "Acrobat is installed" & vbCrLf & _
                "Located in: " & sEXE
            Else
                MsgBox "Acrobat isn't installed"
            End If
        Else
            MsgBox "Acrobat isn't installed"
        End If
    End Sub

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