Copy and rename file using Visual C++ ?

larva

Member
Jul 15, 2001
185
0
0
Hi guys,

Anyone have the source code for copy ,rename and delete file using Visual C++ 6.0 ? Thanks !

regards,
Larva
 

Argo

Lifer
Apr 8, 2000
10,045
0
0
You need three API calls:

CopyFile(...)
MoveFile(...)
DeleteFile(...)


Look up the syntax in MSDN.
 

Adrian Tung

Golden Member
Oct 10, 1999
1,370
1
0
Another API that you may want to look at is the SHFileOperation(...) function.

This function uses the Windows shell to do the copy/rename/delete operations, so you also get the progress bar displayed for free. Pretty useful if you are dealing with a lot of files (or a few very large ones), so you don't have to do the extra work to make your program not look like it is not responding during the operation.


:)atwl