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!!
Printable View
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!!
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.
Well what happens when I don't know where the file is?
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
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