on shutdown quit PUBLIC guTag,gcINIFile gcINIFile=full(curdir())+'config.ini' set proc to gProc,pProc pvSETs() *- pvWorking() ************************************************** FUNCTION pvWorking local cProdName,aFile(1),aFileInfo(1),cFile,nVer,cTmp cProdName=upper(allt(gcGetINIStr(gcINIFile,'Loader','ProductName') )) cPath=allt(gcGetINIStr(gcINIFile,'Loader','Path') ) if empty(cPath) cPath='.' Endif cPath=addbs(cPath) if not directory(cPath) messagebox("Path not found",16,'LOADER',1000*10) return endif CREATE CURSOR csExe ( FileName c(100),Version i,ModifyDate d,ModifyTime c(10) ) For i=1 to Adir(aFile,cPath+'*.exe') cFile=aFile(i,1) AGetFileVersion(aFileInfo,cPath+cFile) If not cProdName==allt(upper(aFileInfo(10))) &&product name loop endif nVer=10^8+val( getwordnum(aFileInfo(4),1,'.') )+ ; 10^4+val( getwordnum(aFileInfo(4),2,'.') )+ ; val( getwordnum(aFileInfo(4),3,'.') ) append blank replace filename with aFile(i,1),; version with nVer,; ModifyDate with aFile(i,3),; ModifyTime with aFile(i,4) Next select * ; from csExe ; order by version desc ,ModifyDate desc,ModifyTime desc,fileName desc; into cursor csTmp if _tally=0 messagebox("There isn't any executable files that have a matched internal product name",; 16,'LOADER of Yxsoft',1000*10) RETURN ENDIF cTmp="run /n1 "+cPath+allt(filename) SET DEFAULT TO (cPath) ExecScript(cTmp) RETURN ********************************************************