473,398 Members | 2,212 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

How to copy all files under a folder to another folder

ad
I want to copy all files under a folder to another folder.
If I use File.Copy(sourceFileName, destFileName, overwrite),
it must specify all files name in the source and destionation.

How can I copy all files in a directoy to another directory?
Jun 25 '06 #1
6 13329
"ad" <fl****@wfes.tcc.edu.tw> wrote:
I want to copy all files under a folder to another folder.
If I use File.Copy(sourceFileName, destFileName, overwrite),
it must specify all files name in the source and destionation.

How can I copy all files in a directoy to another directory?


How about copying them one at a time?

-- Barry

--
http://barrkel.blogspot.com/
Jun 25 '06 #2
ad
But I do'nt know all the files' name under a folder in advance
"Barry Kelly" <ba***********@gmail.com>
???????:69********************************@4ax.com ...
"ad" <fl****@wfes.tcc.edu.tw> wrote:
I want to copy all files under a folder to another folder.
If I use File.Copy(sourceFileName, destFileName, overwrite),
it must specify all files name in the source and destionation.

How can I copy all files in a directoy to another directory?


How about copying them one at a time?

-- Barry

--
http://barrkel.blogspot.com/

Jun 26 '06 #3
"ad" <fl****@wfes.tcc.edu.tw> wrote:
But I do'nt know all the files' name under a folder in advance


Directory.GetFiles() returns a list of the files in a directory.

-- Barry

--
http://barrkel.blogspot.com/
Jun 26 '06 #4
Why not just use Directory.Move()?

Directory.Move(sourceDirectory, destinationDirectory);

"Barry Kelly" wrote:
"ad" <fl****@wfes.tcc.edu.tw> wrote:
But I do'nt know all the files' name under a folder in advance


Directory.GetFiles() returns a list of the files in a directory.

-- Barry

--
http://barrkel.blogspot.com/

Jun 26 '06 #5
rmacias <rm*****@newsgroup.nospam> wrote:
Why not just use Directory.Move()?

Directory.Move(sourceDirectory, destinationDirectory);


Probably because moving isn't copying?

-- Barry

--
http://barrkel.blogspot.com/
Jun 26 '06 #6
You are correct, I mis-read the post.

"Barry Kelly" wrote:
rmacias <rm*****@newsgroup.nospam> wrote:
Why not just use Directory.Move()?

Directory.Move(sourceDirectory, destinationDirectory);


Probably because moving isn't copying?

-- Barry

--
http://barrkel.blogspot.com/

Jun 26 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Frank | last post by:
I have files in myurl.com/myfolder and I would like to copy all of them into myurl.com/newfolder I'd like to copy all of the subdirectories and files that are in /myfolder and I would...
3
by: Johnny | last post by:
Hi, I have created an ASP.NET application (let's call it FooBar) with VS.NET on my local machine, residing in http://localhost/FooBar. Deploying it to another folder on my machine works well...
8
by: Paw | last post by:
Greetings. I use asp. what I need is is when a visitor comes to the site, I need it to check the host name. if "www.hometowndigest.com" is the host, then check a folder named "something" and if...
5
by: Saabster | last post by:
Hi all, It's always the simple stuff that trips you up I guess. Here is the issue I'm dealing with. I have a folder with 1400 excel files that I need to move to another location. Since each...
5
by: anupkossambe | last post by:
Hello guys, I'm working on a code in VB6.0 which involves copying all the files inside a folder to another folder. I have managed to do that but the problem arises when there are subfolders inside...
2
by: TwistedPair | last post by:
All, This is sort of a continuation of a previous post of mine. The code below basically reads a registry key to get a path to a folder and it watches for files created in that folder (only...
0
by: TwistedPair | last post by:
All, I had some great advice about this a bit ago, but I'm just not good enough with this code to put together all the pieces. The way the code below works is as a service. When it is started,...
1
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
Using .NET 2.0 is it more efficient to copy files to a single folder versus spreading them across multiple folders. For instance if we have 100,000 files to be copied, Do we copy all of them to...
2
by: swethak | last post by:
hi, i want to copy the contents of one folder into another folder.For that i create the one new folder . I copied the files of already existing folder into new folder.For that i write a code as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.