Filter a folder before copying it

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • George N
    New Member
    • Aug 2010
    • 7

    Filter a folder before copying it

    I have folders that I want to copy to the server , folders contain HTML and word documents and RTF as well as Images I need to copy the folders but remove from them automatically the word and rtf files any help with that ?


    the code below I wrote will copy the folder as it is :

    Code:
     With FBD
    
                .RootFolder = Environment.SpecialFolder.Desktop
    
    
    
                .SelectedPath = "C:\windows"
                .Description = "Select  Data Folder Source"
    
                If .ShowDialog = DialogResult.OK Then
    
                    MessageBox.Show("You have selected " & .SelectedPath)
    
    
    
                End If
    
    
    
    
    
                Try
    
    
                    My.Computer.FileSystem.CopyDirectory(.SelectedPath, "\\SERVER\demo", FileIO.UIOption.AllDialogs)
    
                Catch F As Exception
                    MsgBox(F.Message.ToString)
    
                End Try
    
    
    
    
    
            End With
    any help please ?
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    You could copy the folder and then delete the files or you could create the folder and then copy the files individually.

    Comment

    Working...