Using SHFileOperation from VFP is described in this article:
http://www.foxite.com/arch
VB code is here http://vbnet.mvps.org/inde
Main Topics
Browse All TopicsI am looking for a way to copy files/tables in use that are not exclusive to another folder on the same computer. I have heard about SHFileOperation Win32 API but can't find much helpfull information on it. Has anyone use it before and is that the best API to use.
Thanks,
-Greg
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Using SHFileOperation from VFP is described in this article:
http://www.foxite.com/arch
VB code is here http://vbnet.mvps.org/inde
I'm not sure why you are bothering with an 'external' method such as SHFileOperation when 2 perfectly good and easy to use methods already exist within Foxpro/Visual Foxpro.
Pavel (pcelba) already showed you above how to Copy DBF files and non-DBF files in a very simple manner.
If, by chance, you are not using FP/VFP, then you are probably posting in the wrong language-specific forum.
Good Luck
Problem of COPY FILE command is almost none progress animation. SHFileOperation offers it and the link published in answer ID:25370684 shows how to call it from FoxPro. VB related link was added just in case author is in wrong EE zone :-).
And it is also good if others will extend the already posted answer.
This kind of API call is obviously used when customer asks for it explicitly. Yes, ve've used it before, unfortunately, none of us can say if SHFileOperation is the best API to use because we all are using COPY TO and COPY FILE... :-)
Business Accounts
Answer for Membership
by: pcelbaPosted on 2009-09-18 at 15:56:59ID: 25370633
If these files are not in exclusive use then you may do it in Visual FoxPro following way:
1) for DBF tables:
USE table SHARED
COPY TO NewLocation WITH CDX
2) for file of any type:
COPY FILE YourFie TO YourNewFile
An exception can rise if copied files are open exclusively by another process. But it is easy to handle it.