Application Detection Method – Check for File or Registry Entry

Use this VB script to check for the existence of a specific file or registry entry. ON ERROR RESUME NEXT file=”c:\Program Files (x86)\Microsoft Office\Office15\Outlook.exe” Set fso = CreateObject(“Scripting.FileSystemObject”) If (fso.FileExists(file)) Then ‘file exists Else ‘file does not exist ‘check for uninstall registry key Set WSHShell = CreateObject(“WScript.Shell”) str_key = “HKLM\Software\Unilever\Packages\Uninstall\OFFICE02013\OFFICE02013-Office2013-Uninstall” str_value = WshShell.RegRead(str_key) if str_value = “Uninstalled” then ‘uninstall reg key exists – uninstall ran else ‘uninstall reg key doesnt exist – uninstall hasnt run wscript.echo “Success” end if End if

Read More