>This is a serious question even though it sounds sarcastic: If that's all you need, what is all the other stuff in Ed's example for? I'm sure it all serves a purpose since it wouldn't make any sense for him to throw in a bunch of stuff you don't need. I guess what I'm asking is what does his do that yours doesn't? Which probably isn't the best question for you since you said you hadn't used his. :) But maybe someone else reading the thread has used Ed's example and can chime in?
SHFileOperation() will do considerably more than CopyFile() - it allows the specification of multiple source file masks, multiple target directories, overwrite behaviors, recovery from errors encountered in the execution, the display of the Windows dialog and animations and recursion of subfolders when copying. It supports undo operations and confirmation dialogs. It also will handle Delete, Move and Rename functions. It supports collision prevention (rename files when the file currently exists in the target directory.) It will perform a copy when the file is open as long as it is shared and no write locks have been issued. It will work without having the WSH installed, as long as the necessary Shell version has been installed.
IOW, the two are not the same - SHFileOperation() offers support for the functions done by CopyFile(), and much more.
>>Michelle,
>>
>>Only a kind of answer to Q1. Never used SHFileOperation.
>>It's straight and simple
>>
>>
>>declare Integer CopyFile in win32api string @, string @, Integer
>>local FileFrom, FileTo
>>
>>FileFrom ='C:\tmp\xxx'
>>FileTo = 'c:\tmp\yyy'
>>if( empty(CopyFile(@File_From, @File_To, 0)) )
>> return FALSE
>>endif
>>
>>you can find the doc at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/filesio_0x9h.asp