LOCAL cExtn,cAppKey,cAppName LOCAL oReg,regfile cAppKey = "" cAppName = "" oReg = NewObject("FileReg",HOME()+"FFC\registry.vcx") * Get Application nErrNum = oReg.GetAppPath('DOC',@cAppKey,@cAppName) * Remove switches here (i.e., C:\EXCEL\EXCEL.EXE /e) IF ATC(".EXE",m.cAppName) #0 m.cAppName= ALLTRIM(SUBSTR(m.cAppName,1,ATC(".EXE",m.cAppName)+3)) IF ASC(LEFT(cAppName,1))=34 &&check for long file name in quotes m.cAppName = SUBSTR(m.cAppName,2) ENDIF ENDIF ? 'App:',LOWER(m.cAppName) ? 'Version:', RIGHT(m.cAppKey,1)Also if your main concern is to check if a class is registered rather than to know its path (ie:if createobject('word.application') would work or not) then you could also use this :
*Function IsClassRegistered lparameters tcClass #DEFINE HKEY_CLASSES_ROOT -2147483648 #DEFINE ERROR_SUCCESS 0 && OK DECLARE Integer RegOpenKey IN Win32API ; Integer nHKey, String @cSubKey, Integer @nResult DECLARE Integer RegCloseKey IN Win32API ; Integer nHKey local lnKey lnKey = 0 llRetVal = ( RegOpenKey(HKEY_CLASSES_ROOT, tcClass, @lnKey) = ERROR_SUCCESS ) if llRetVal RegCloseKey(lnKey) endif return llRetValCetin