Solved

copy files

Posted on 2008-06-25
7
218 Views
Last Modified: 2013-11-26
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
Comment
Question by:CalmSoul
  • 4
  • 3
7 Comments
 
LVL 48

Expert Comment

by:jpaulino
ID: 21869793
Hi CalmSoul,


You can use:

my.Computer.FileSystem.CopyDirectory(source, destination)
0
 
LVL 5

Author Comment

by:CalmSoul
ID: 21869805
my source is where my project executable is... how can i do that?
0
 
LVL 5

Author Comment

by:CalmSoul
ID: 21869810
any imports for this command?
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 48

Expert Comment

by:jpaulino
ID: 21869906
You can use this:

My.Computer.FileSystem.CopyDirectory(Application.StartupPath + "\", "C:\DestinationPath\")
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 21869913
Application.StartupPath + "\", will give you the EXE path, you just need to add the folder name like

Application.StartupPath + "\folder1\"
0
 
LVL 5

Author Comment

by:CalmSoul
ID: 21870126
whats wrong with this ?

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

Accepted Solution

by:
jpaulino earned 500 total points
ID: 21870180
Try this way:

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

0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question