*-*** move files around *-*** move to history curpath = SYS(5)+SYS(2003) USE DirPaths EXCL SET ORDER TO TAG DirPath ** get the last month IF VAL(monthtoprocess) <> 1 month1 = VAL(monthtoprocess) - 1 ELSE month1 = 12 ENDIF month1 = SUBSTR(CMONTH(CTOD(STR(month1)+"/01/"+STR(YEAR(DATE())))),1,3) * copy last months phone.num files to OLD directory SCAN * DirPath already contains a leading backslash mcopy = curpath +(ALLTRIM(DirPath))+ "\*.* to " + curpath+"\old\" + ; ALLTRIM(month1)+"\"+(ALLTRIM(DirPath)) COPY FILE &mcopy ENDSCAN ** unmark read only mflag = "flag " + curpath + "\*.* -ro /c /s" !&mflag IF NOT USED('Phone') SELECT 0 USE phone ELSE SELECT Phone ENDIF SET ORDER TO TAG KeyFld IF NOT USED('DirPaths') SELECT 0 USE DirPaths ELSE SELECT DirPaths ENDIF SET ORDER TO TAG KeyFld GO TOP DO WHILE NOT EOF('DirPaths') ** delete existing phone.num files from DirPath mdel = (curpath + ALLTRIM(DirPaths.DirPath) + "\*.*") DELETE FILE &mdel * now copy new phone.num files from \phone#\phone.num to DirPath * the files are new because the fonebill program was previously run SELECT phone =SEEK(KeyFld,'Phone','KeyFld') DO WHILE phone.KeyFld = DirPaths.KeyFld .AND. NOT EOF('Phone') mcopy = curpath + "\phone#\" + phonenumbe + " to " + ; curpath + ALLTRIM(DirPaths.DirPath) COPY FILE &mcopy SKIP ENDDO SELECT DirPaths SKIP ENDDO mflag = "flag " + curpath + "\*.* +ro /c /s"You can also use the VFP "RUN" command, as described in the help.