Solved

copy files

Posted on 2008-06-25
7
233 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PowerShell:  Column widths won't expand 3 47
Why use this lambda? 12 60
PowerShell: ForEach ($y in $x.licenses | where {....} 3 53
c#, case, if 4 16
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

685 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