473,466 Members | 1,347 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

I Cannot find a copy fiolder method in System.IO

I need to copy (not move) a directory and all of its contents to another Location Disk / Server / Universe etc.

But I cannot find a Copy method on the Directory or DirectoryInfo objects only a move.
There is a copy on the FileInfo.
I would have to write a recursive procedure to loop through the source directory creating destination directories and copying files to them.
I am quite capable of writing such a procedure, but I don't think that I should have to. I also do not want to use the Scripting.FileSystemObject which will do this very easily.

Any thoughts please

Ben
Jul 21 '05 #1
4 1489
Hi Ben,

It is funny, this question comes regulary, however not often and at almost
the same time it was from someone else in the newsgroup.
microsoft.public.dotnet.vb.

I've never seen an answer on this question. In the vb.language group OHM
gave the answer to use a commandline copy for this. (I think xcopy)

I hope it helps anyhow?

Cor
Jul 21 '05 #2
I am not suprised that the question is often Asked - If the Search facility worked on this newsgroup, I might have been able to find some past instances of it. :*)

Is it possible that this functionality has simply been overlooked by the .net framework developers?

"Cor Ligthert" wrote:
Hi Ben,

It is funny, this question comes regulary, however not often and at almost
the same time it was from someone else in the newsgroup.
microsoft.public.dotnet.vb.

I've never seen an answer on this question. In the vb.language group OHM
gave the answer to use a commandline copy for this. (I think xcopy)

I hope it helps anyhow?

Cor

Jul 21 '05 #3
You might try looking at the DirectoryInfo and Directory classes. I believe they can can copy directories and/or move directories.
--
Dennis in Houston
"Ben Reese" wrote:
I am not suprised that the question is often Asked - If the Search facility worked on this newsgroup, I might have been able to find some past instances of it. :*)

Is it possible that this functionality has simply been overlooked by the .net framework developers?

"Cor Ligthert" wrote:
Hi Ben,

It is funny, this question comes regulary, however not often and at almost
the same time it was from someone else in the newsgroup.
microsoft.public.dotnet.vb.

I've never seen an answer on this question. In the vb.language group OHM
gave the answer to use a commandline copy for this. (I think xcopy)

I hope it helps anyhow?

Cor

Jul 21 '05 #4
Dennis - I refer you to my original post

"But I cannot find a Copy method on the Directory or DirectoryInfo objects only a move."

Ben
"Dennis" wrote:
You might try looking at the DirectoryInfo and Directory classes. I believe they can can copy directories and/or move directories.
--
Dennis in Houston
"Ben Reese" wrote:
I am not suprised that the question is often Asked - If the Search facility worked on this newsgroup, I might have been able to find some past instances of it. :*)

Is it possible that this functionality has simply been overlooked by the .net framework developers?

"Cor Ligthert" wrote:
Hi Ben,

It is funny, this question comes regulary, however not often and at almost
the same time it was from someone else in the newsgroup.
microsoft.public.dotnet.vb.

I've never seen an answer on this question. In the vb.language group OHM
gave the answer to use a commandline copy for this. (I think xcopy)

I hope it helps anyhow?

Cor

Jul 21 '05 #5

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

Similar topics

8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
0
by: Don | last post by:
I intermittently get a runtime Compilation Error that says 'The compiler failed with error code 2000'. It appears that a DLL cannot be found in the 'temporary asp.net files' directory. The...
4
by: Ben Reese | last post by:
I need to copy (not move) a directory and all of its contents to another Location Disk / Server / Universe etc. But I cannot find a Copy method on the Directory or DirectoryInfo objects only a...
6
by: chanmm | last post by:
Dear all, I have run the same web application in my Windows XP Pro without any problem but once I deploy it in Windows 2003 Server the message below appear: The system cannot find the file...
0
by: Patrick F | last post by:
I keep getting this error message and i don't know whats the problem is and how to solve it. I have a webproject with 2 components (dll) added to it. One is called PhotoGallery and one is called...
1
by: Patrick F | last post by:
I keep getting this error message and i don't know whats the problem is and how to solve it. I have a webproject with 2 components (dll) added to it. One is called PhotoGallery and one is called...
3
by: Yusuff | last post by:
Hi, I Have created an external assembly to generate a GUID. The class is static. I am trying to access it in the Message Assignment shape in the orchestration. It seems that I can access the...
1
by: Scott M. | last post by:
Many methods return objects when they are called. With Excel these objects are placed in memory and must be destroyed via ReleaseComObject as you have done with your NAR method, but the line: ...
4
by: =?Utf-8?B?VG9yZW4gVmFsb25l?= | last post by:
Was editing code, am getting the following errors } expected Type or namespace definition, or end-of-file expected Eyes crossed cannot find code below! using System; using...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.