• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

copy files

Using visual basic 2005 how can I copy file from folder(s) to multiple folder

for example

I have folder 1, folder 2, and folder 3

I want to copy folder 1 to c:\a\ed\op\
I want to copy folder 2 to c:\op\a\q
I want to copy folder 3 to c:\op\uj\op

How is this possible using visual basic 2005 studio
0
CalmSoul
Asked:
CalmSoul
  • 4
  • 3
1 Solution
 
jpaulinoCommented:
Hi CalmSoul,


You can use:

my.Computer.FileSystem.CopyDirectory(source, destination)
0
 
CalmSoulAuthor Commented:
my source is where my project executable is... how can i do that?
0
 
CalmSoulAuthor Commented:
any imports for this command?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
jpaulinoCommented:
You can use this:

My.Computer.FileSystem.CopyDirectory(Application.StartupPath + "\", "C:\DestinationPath\")
0
 
jpaulinoCommented:
Application.StartupPath + "\", will give you the EXE path, you just need to add the folder name like

Application.StartupPath + "\folder1\"
0
 
CalmSoulAuthor Commented:
whats wrong with this ?

My.Computer.FileSystem.CopyDirectory(Application.StartupPath + "\folder1\", "" & Me.FolderBrowserDialog1.SelectedPath.ToString + "b\a\" & ")
0
 
jpaulinoCommented:
Try this way:

My.Computer.FileSystem.CopyDirectory(Application.StartupPath + "\folder1\", "" & Me.FolderBrowserDialog1.SelectedPath.ToString + "\b\a\" & ")

0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now