Copy a Directory and paste it in a new address


How about!

I'm trying to copy a directory with files being copied and pasted in another route, I have this.

    Dim Carpeta As String
    Carpeta = Path.Combine(SERVIDOR, DATA)
    FileSystem.FileCopy("-22910", Carpeta)

The FileSystem.FileCopy is for a file, but I need to copy the whole directory, does anyone know of a function that I could use?

asked by ARR 12.01.2018 в 19:37

1 answer


If you wish to copy a directory, you can use FileSystem.CopyDirectory () to copy all the contents of one directory to another.

 My.Computer.FileSystem.CopyDirectory("C:\Data\directorio_fuente", "C:\Data\directorio_destino", True)
  • directorio_destino is created if it does not exist.

can even be used with UNC:

 My.Computer.FileSystem.CopyDirectory("\server\directorio_fuente", "C:\Data\directorio_destino", True)
answered by 12.01.2018 / 20:03