views:

33

answers:

2

Hello everyone,

I've searched the web and stackoverflow for this.

I want to copy multiple files from multiple sources to multiple destinations. I don't bother with UnauthorizedAccessExceptions yet - the files are most likely to not be in use anyway.

I can copy 1 file using CopyFileEx-Wrapper from here. However: I'd like the standard windows copy file dialog to appear. And I'd like to copy multiple files - not just one - by e.g. passing an array of source files and an array of destination files.

Is there a way to do this? Further more: is there a way to queue this as one task and not x separated copy operations? The reason for this is the fact that I'd like to display only one progressing dialog - from the start till the end of copying all files.

I hope my question is clear.

Thank you all very much in advance.

divStar.

+1  A: 

Set the MultiSelect property of your OpenFileDialog to true.

Robert Harvey
+1  A: 

Yes, this is possible with the IFileOperation shell interface, available since Vista. A managed class wrapper for this COM interface is available in this magazine article.

Fall back on your existing code if it also needs to run on earlier versions of Windows.

Hans Passant
Thank you :D. It does do exactly what I want it to - too bad I should check whether my application runs on Windows Vista or 7 before involving that functionality..
Igor