We help IT Professionals succeed at work.

How do you overwrite files when copying them in Foxpro

Conroy111 asked
I have a list of jpg files in a table (about 8000 of them) and they are mixed in with about 5000 redundant ones. I have written a simple program to get the filenames from the table and copy them to another folder and this works OK except a few hundred of them have their name duplicated in the table and when it comes to copy these again I have to click yes or no to overwrite the existing ones.  Is there a command I can put in the program that will automatically overwrite (or not) the files so I can let the program run un-attended?
Watch Question

Firstly I would recommend double checking you code to see why you have duplicates, maybe you are truncating the name if field is not long enough?

If you are certain you want to overwrite the files, then use


Open in new window

before your copy command, but don't forget to turn back ON afterwards.


Thanks a million.  I knew there was a simple solution.
The duplicate names are necessary as the same image is used quite a number of times in the application.