#DEFINE UsingAPI .T. #IF UsingAPI DECLARE INTEGER ShellExecute ; IN SHELL32.DLL ; INTEGER nWinHandle,; STRING cOperation,; STRING cFileName,; STRING cParameters,; STRING cDirectory,; INTEGER nShowWindow #ENDIF lcPSPPath = "C:\Program Files\Jasc Software Inc\Paint Shop Pro 9\Paint Shop Pro 9.exe" IF FILE(lcPSPPath) CD (JustPath(lcPSPPath)) #IF UsingAPI ShellExecute(0, "Open",JustSTem(lcPSPPath), "", JustPath(lcPSPPath), 1) #ELSE RUN (JustSTem(lcPSPPath)) && Just Run with internal VFP run command #ENDIF ENDIFAnother options to the File() function:
Function SureFile LParameters tcFileName Local lcOldPath Local llRetValue lcOldPath = SET("PATH") SET PATH TO llRetValue = File(m.tcFileName) SET PATH TO &lcOldPath Return llRetValue EndFuncOption 2
Function SureFile LParameters tcFileName RETURN (ADIR(laDummy, m.tcFileName) > 0) EndFuncOption 3
Function SureFile LParameters tcFileName RETURN NOT EMPTY(SYS(2000,m.tcFileName)) ENDFuncOption 4
*** In your init program, just once ***** declare Integer GetFileAttributes in win32api string @ **************************************** Function SureFile LParameters tcFileName return (GetFileAttributes(@m.tcFileName) <> -1) EndFuncHTH
FILE("C:\Program Files\Jasc Software Inc\Paint Shop Pro 9\Paint Shop Pro 9.exe")>This is the short file name for the file: "C:\PROGRA~1\JASCSO~1\PAINTS~2\PAINTS~1.EXE"