Function GetExecutable LPARAMETERS tcExtension LOCAL cExtn,cAppKey,cAppName,nErrNum,cNewKey LOCAL oReg,cVersion cAppKey = "" cAppName = "" oReg = NewObject("FileReg",HOME()+"samples\classes\registry.prg") * Get Application IF( oReg.GetAppPath(m.tcExtension,@cAppKey,@cAppName) # 0 ) RETURN '' ENDIF * 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 RETURN m.cAppNameCetin