DECLARE LONG CopyFile IN WIN32API STRING lpExistingFileName, STRING lpNewFileName, LONG bFailIfExists
lnRetval = CopyFile("c:\autoexec.bat", "d:\autoexec.bat", 1)
IF lnRetval = 1
MESSAGEBOX("File Copied"
ELSE
MESSAGEBOX("Error"
ENDIF
-----------------------------------------------------
Note that the native COPY FILE takes less programming.
COPY FILE fromFile toFile
REMEMBER TO ADD FILE EXTENSION AND AS TEXTS (EXAMPLE fromFile = "MyDBF.DBF" etc.) WildCard characters will not function ... Caution !
-----------------------------------------------------
You can also use the run command and do the native OS command
Example: RUN XCOPY fromDir toDir /s
-----------------------------------------------------
IF you are speaking of FPD (FoxPro DOS), I know of no way to do this. If you are using FPW (FoxPro for Windows), then there may be an answer.
Unfortunately it's not a "simple" Foxtools call. Because "CopyFile" is in Kernel32.dll which is a 32-bit .DLL, you can't directly call it from FPW - a 16-bit environment. If you want to try, first go to Rick Strahl's site
and get Call32 - it allows you to call Win32 functions from FPW 2.x. I've had some luck with this routine for some API calls, but others "hung" the system <s>.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.