Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coping a Folder

Status
Not open for further replies.

minckle

Programmer
Mar 17, 2004
142
GB
Is there a way in delphi v5 to Copy a Folder from 1 place to another.

I know you can copy files but how do u coopy a whole folder

Thanks
 
There is no copyfolder command but you can do this.

use MkDir(nameoffolder); to make a new folder where you want it.
Then copy all files to the new folder.
use findfirst and findnext with *.* parameter to get all the files in the folder, if there are subfolders it gets more complex, there have been some recent posts on this subject.



Steve
Be excellent to each other and Party on!
 
Have a look in this thread thread102-963082
But you will have to develop these examples to get the names of sub folders as well as the files.


Steve
Be excellent to each other and Party on!
 
thanks to Bill Gates, you can simply do this with the explore shell API functions, here's a site with code that uses this :


you can change the behaviour of ShFileOperation through the SHFILEOPSTRUCT Structure, here's the MSDN link if you want more info about it :

cheers

--------------------------------------
What You See Is What You Get
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top