473,748 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is there an easy way to copies all files in a directory into another directory?

Is there an easy way to copies all files in a directory into another
directory?
What about coping subdirectories too?

Thanks in advance for any info
Dec 16 '05 #1
23 2430
You mean like XCOPY?

" **Developer**" <RE************ *@a-znet.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Is there an easy way to copies all files in a directory into another
directory?
What about coping subdirectories too?

Thanks in advance for any info

Dec 16 '05 #2
I'm sorry, I meant programatically .
Thanks
"bill" <be****@datamti .com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
You mean like XCOPY?

" **Developer**" <RE************ *@a-znet.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Is there an easy way to copies all files in a directory into another
directory?
What about coping subdirectories too?

Thanks in advance for any info


Dec 16 '05 #3
Open VS Help and search on File Class.

Dec 16 '05 #4
> I'm sorry, I meant programatically .
Thanks


And you asked an easy way and the answer was XCOPY. Did you try it?

(You did not ask for the most controlled way)

Cor
Dec 16 '05 #5
I've used the File class before but never to copy an entire folder contents.

Just looked again and do not see a method for copying entire folder.
Am I missing something or are you suggesting I use the Copy method to copy
the files one at a time?
Thanks

PS

I'm presently using the FileSystem's FileCopy method to copy them one at a
time and am wondering if there is a better way.

<za***@construc tion-imaging.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
Open VS Help and search on File Class.

Dec 16 '05 #6
Yes, I've used XCOPY since DOS.
"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
I'm sorry, I meant programatically .
Thanks
And you asked an easy way and the answer was XCOPY. Did you try it?

Yes, I've used XCOPY since DOS. And always liked it.
(You did not ask for the most controlled way)
What is the most controlled way to copies all files in a directory into
another directory?
What about coping subdirectories too?

Thanks in advance for any info

Cor


Thanks for the implied suggestion.
Dec 16 '05 #7
Great on two accounts:
1) Answers my question: No there isn't an easy way!
2) Gives me a general solution that I can use.

Thanks a lot
"Greg Burns" <bl*******@news groups.nospam> wrote in message
news:u1******** ******@TK2MSFTN GP09.phx.gbl...
Attached is some code that copies one directory to another recursively so
as
to include subfolders. Hopefully it will get you started.

Greg

Dec 16 '05 #8
> Yes, I've used XCOPY since DOS.

Than why not try it. It is not nice as I wrote and withouth any control,
however it goes and easy. You can hide the Dos window if you want.

\\\
Dim p As New Process
p.StartInfo.Arg uments = "C:\Test1 C:\TestA\"
p.StartInfo.Fil eName = "xcopy"
p.Start()
///

I hope this helps,

Cor
Dec 16 '05 #9
> Great on two accounts:
1) Answers my question: No there isn't an easy way!
2) Gives me a general solution that I can use.


You got from Bill and easy solution 7 minutes after that you placed your
question here.

The way you replied on that did him probably not give you any more
information.

I asked again why it did not fit, and got a same kind as answer as you gave
to Bill.

In my opinion not the best way to get some help in a newsgroup.
However feel free to continue that.

By the way the message I have sent with the complete Xcopy code was before I
had read you message I am answering now.

Cor



Dec 16 '05 #10

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

Similar topics

6
2205
by: JW | last post by:
I'm displaying product thumbnails with brief descriptions on web pages. Clicking on the product does a javascript popup with larger image and detailed description info passed to the javascript functions from the table data. Products can change frequently, and I want to make the maintenance of this info easier by non-techies (each product has an image name, image width (currently not using getimagesize), a short description, and a long...
1
7130
by: jajoo | last post by:
Hi everyone, I am trying to send files with multipart/form-date. Everything is ok with the send. But when I am receiving the files I should specify a directory where the files to be saved. The problem is that Tomcat saves the files into %CATALINA_HOME%/bin directory. I am wondering why? Why not into my application directory? The application directory is %CATALINA_HOME%/webapps/picture. As a parameter of directory I am giving "." – which...
9
3204
by: Hans-Joachim Widmaier | last post by:
Hi all. Handling files is an extremely frequent task in programming, so most programming languages have an abstraction of the basic files offered by the underlying operating system. This is indeed also true for our language of choice, Python. Its file type allows some extraordinary convenient access like: for line in open("blah"): handle_line(line)
8
1936
by: Adam Clauss | last post by:
I have a folder containing many subfolders (and subfolders and....) all containing various .cs files. Is there any "easy" way to get them all added to the solution. Preferable would be that the folders are actually created in the Solution Explorer so that I can find things easily. Its easy to select multiple files out of a single folder, but not recursively into subfolders. Any ideas? -- Adam Clauss
3
1317
by: Rob Meade | last post by:
Hi all, I have created 7 web custom controls for 7 sections of our template. I have them currently on my local pc - where vs placed them...the plan was that I would create these - throw them into a central location then the rest of our team would be able to use them to create our generic template for our applications etc... One thing I've noticed is when I opened up a new webform and created my
18
2302
by: UJ | last post by:
Folks, We provide custom content for our customers. Currently we put the files on our server and people have a program we provide that will download the files. These files are usually SWF, HTML or JPG files. The problem as I see it - if you know the name of the file, you could download it off the server (currently we are using an HTTP/Get but I'm going to be using WebClient in the new version.) If there any way to password protect the...
2
2613
by: BLetts | last post by:
I have an ASP.NET app that must allow users to upload files. The files are stored in a virtual directory. I use Server.MapPath to map from the virtual directory name to a physical path, then the FileUpload control SaveAs method to upload and save the file. This all works fine when the virtual directory points to a local drive on the ASP.NET server. However, when pointing to a remote drive (which is what my client wants to do), I get...
2
1951
by: Chris Ashley | last post by:
I've written a C++ Wrapper DLL which I need to add a reference to in my ASP.Net project. This in turn is dependent on the DLL it wraps which is in turn dependent on some other DLLs. When I reference the wrapper DLL VS2005 copies it to the 'bin' directory and I am unable to compile with the error 'the specified module could not be found'. It still has the same behaviour if I copy all the dependent DLLs to my bin directory, but this isn't a...
15
1417
by: Andy B | last post by:
I need to count files in a certain directory that has the string -Contract Template.xml at the end of it. How would I do this?
0
8995
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9558
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9378
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9253
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6077
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3316
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2216
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.