WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

How To
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Check if Program is Installed

 Keywords: Determine Check Program Application EXE Install Installed Word Excel Access Office

installed = 0
progid = 'Word.Application' ; programmatic identifier of application
appname = 'Word'

; Check the registry ( 2 places )
;    Uninstall section
key = RegOpenKey( @REGMACHINE, 'Software\Microsoft\Windows\CurrentVersion\Uninstall' )
list = RegQueryKeys( key )
RegCloseKey( key )
If ItemLocate( StrLower( appname ), StrLower( list ), @TAB ) Then installed = 1
;    Prog ID
targetkey = RegExistKey( @REGCLASSES, progid )
If targetkey Then installed = 1

; Check for abilty to create a reference to a COM object.
ErrorMode( @OFF )
object = ObjectCreate( progid )
ErrorMode( @CANCEL )
If object
   installed = 1
   object = 0 ; Close object
EndIf

Pause( 'Word Install Checker', installed )
Exit

Article ID:   W17912
Filename:   Check if Program is Installed.txt
File Created: 2010:01:08:10:43:40
Last Updated: 2010:01:08:10:43:40