?GetAppPath("ZIP")
Here's the code for GetAppPath(). It uses the registry class that ships with VFP. This works fine as long as an app is registered. This should be much faster than trying to locate an app on all drives.PROCEDURE GetAppPath(tcExtension) *-- returns the application path from the registry LOCAL loReg, lcAppKey, lcAppPath, lnErrNum loReg = NEWOBJECT("FileReg", HOME() + "ffc\registry") lcAppKey = "" lcAppPath = "" lnErrNum = loReg.GetAppPath(tcExtension, @lcAppKey, @lcAppPath) RELEASE loReg IF lnErrNum 0 *??CHR(7) *WAIT WINDOW NOWAIT "Could not determine associated program for '" + tcExtension +"'" RETURN "" ELSE *-- return path only (e.g. remove stuff like %1, /e, etc.) RETURN SUBSTR(lcAppPath, 1, ATC(".EXE", lcAppPath) + 4) ENDIF ENDPROCHTH