Detect if Adobe Reader is installed using VB code

I want to determine if Adobe Reader is installed using VB6. Also, if it is found that it is not installed, what would be the best solution?

+3
source share
3 answers

There are rough ways (checking files in the program files directory), but I would recommend that you declare the full registry functions (and not getSetting from vb), as in http://www.windowsdevcenter.com/pub/a/windows/2004/06 /15/VB_Registry_Keys.html and select

HKEY_CLASSES_ROOT \ .pdf

If it is there, then there is something that can read pdf files (what do you need, right?).

HKEY_CLASSES_ROOT \.pdf\OpenWithList , .pdf... - , vb ( "start" + OpenAppName)

+1

"HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat Reader" . "Adobe Reader" ( "Acrobat Reader" ), .

http://pdftohtml.sourceforge.net/ , PDF , html -, .

+1

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\

. , .

Root , - PDF Reader .

, PDF , . ( VBScript, VB6)

File = <PDF FILE HERE>
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run Chr(34) & File & Chr(34)

vb6, RegRead - . WMI - . WMI, .

There is nothing wrong with reading HKEY_CLASSES_ROOT, but if you are just going to start the PDF handler by default, why not just start it with the WshShell.Run command above? You are doing the same thing with one smaller step.

0
source

Source: https://habr.com/ru/post/1699096/


All Articles