PC Review


Reply
Thread Tools Rate Thread

How to copy all files under a folder to another folder

 
 
ad
Guest
Posts: n/a
 
      26th Jun 2006
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?


 
Reply With Quote
 
 
 
 
Barry Kelly
Guest
Posts: n/a
 
      26th Jun 2006
"ad" <(E-Mail Removed)> 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/
 
Reply With Quote
 
ad
Guest
Posts: n/a
 
      26th Jun 2006
But I do'nt know all the files' name under a folder in advance


"Barry Kelly" <(E-Mail Removed)>
???????:(E-Mail Removed)...
> "ad" <(E-Mail Removed)> 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/



 
Reply With Quote
 
Barry Kelly
Guest
Posts: n/a
 
      26th Jun 2006
"ad" <(E-Mail Removed)> 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/
 
Reply With Quote
 
=?Utf-8?B?cm1hY2lhcw==?=
Guest
Posts: n/a
 
      26th Jun 2006
Why not just use Directory.Move()?

Directory.Move(sourceDirectory, destinationDirectory);

"Barry Kelly" wrote:

> "ad" <(E-Mail Removed)> 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/
>

 
Reply With Quote
 
Barry Kelly
Guest
Posts: n/a
 
      26th Jun 2006
rmacias <(E-Mail Removed)> wrote:

> Why not just use Directory.Move()?
>
> Directory.Move(sourceDirectory, destinationDirectory);


Probably because moving isn't copying?

-- Barry

--
http://barrkel.blogspot.com/
 
Reply With Quote
 
=?Utf-8?B?cm1hY2lhcw==?=
Guest
Posts: n/a
 
      26th Jun 2006
You are correct, I mis-read the post.

"Barry Kelly" wrote:

> rmacias <(E-Mail Removed)> wrote:
>
> > Why not just use Directory.Move()?
> >
> > Directory.Move(sourceDirectory, destinationDirectory);

>
> Probably because moving isn't copying?
>
> -- Barry
>
> --
> http://barrkel.blogspot.com/
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy files from folder and rename in destination folder burl_h Microsoft Excel Programming 0 31st Jan 2009 01:09 PM
Copy all files from a folder to another folder, recursively pamela fluente Microsoft C# .NET 10 20th Jul 2007 06:04 PM
Copy all files from a folder to another folder, recursively pamela fluente Microsoft VB .NET 10 20th Jul 2007 06:04 PM
Copying CD files to folder, then copy folder to another hard drive, explorer hangs zoner@cox.nospam.net Windows Vista File Management 1 31st Mar 2007 06:07 PM
How to copy 30 csv files from a folder to another folder =?Utf-8?B?ZGRpaWNj?= Microsoft Excel Programming 1 17th Jul 2005 09:42 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:07 AM.