Click here to Skip to main content
15,891,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I just want to try to Copy Selected Files and folders together. Not copy a single Directory or Select Files.

in A main Folder there are : B, C, D, E Subfolders.
and in A Main Folder there are files as : file1.docx, File2.pdf, File3.jpg, File4.mp3

How can I copy FolderB and File2 and File4 togerher with multiselect ?

is it possible ?

I can Coppy MultiSElect Files with openfiledialog or copy folder with folderbrowsdialog

but I couldnt do and couldnt find in internet.

What I have tried:

VB
If OpenFileDialog1.ShowDialog() = DialogResult.OK Then

                Dim sayi As Integer = Me.OpenFileDialog1.FileNames.Length - 1
                For i As Integer = 0 To sayi
                   
                    ListBox1.Items.Add(OpenFileDialog1.FileNames(i))

                Next
               
            End If
Posted
Updated 3-Dec-18 4:11am

Hi,

I don`t think so you can find any function that provides you this much high flexibility to get your list of files and folders and copy them somewhere just as multi-selection copy-paste in Windows directory browser. But, you can build one. Do following:

1- Create a list of strings
2- Add all path of File2 and File4 into the list
3- Create a folder with the same folder name (in this case B) at your targeted destination
4- Use general IO.File functions to copy the files listed in step 2 into the destination path

Good luck, let me know if you need more help.
 
Share this answer
 
Yes as you said I Created a solution and I can coppy : multi Selected Folders (one bye one) and Selected Files (Multilect) at one times. all folders (more then one and also multi Selected Files which listed in listbox can coppy all together. Folders to folder files to under folder.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900