Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

copy files

Posted on 2008-06-25
7
Medium Priority
?
253 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
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 2000 total points
ID: 21870180
Try this way:

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

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

670 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