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

Home Posts Topics Members FAQ

Copy Directory

I found a real nice article on how to copy a directory on MSDN. The
only problem is that I can not figure out how to get the namespace
Microsoft.Visua lBasic.MyServic es. I wanted to know if anyone else has
had experience with this, or knows of a different way to copy a
directory using VB.

I found ways to copy files, but not having a lot of luck with finding a
way to copy a directory other then this information I am finding on
MSDN.

Thanks

Scott Moore

Sep 25 '06 #1
12 2539
I found my error, it is for 2.0. I need to upgrade to 2.0 to get it to
work.

samoore33 wrote:
I found a real nice article on how to copy a directory on MSDN. The
only problem is that I can not figure out how to get the namespace
Microsoft.Visua lBasic.MyServic es. I wanted to know if anyone else has
had experience with this, or knows of a different way to copy a
directory using VB.

I found ways to copy files, but not having a lot of luck with finding a
way to copy a directory other then this information I am finding on
MSDN.

Thanks

Scott Moore
Sep 25 '06 #2
Scott,

You may or may not like this method, but I thought I'd post it anyway.

You could use xcopy in a .bat file to copy the directory from one
location to another. Using different switches for xcopy you can include
hidden files, subdirectories, ignore errors, automatically create
subdirectories, turn message prompts off and a bunch of other options.
Here is a complete list of switch options for xcopy:

http://www.computerhope.com/xcopyhlp.htm

You could call this .bat file using
System.Diagnost ics.Process.Sta rt([Path To .bat File])
I think you should be able to hide the command window from showing up.

By starting a new process you would be able to tell when the process
finishes. Additionally you could modify the .bat file in the future so
code changes would not be necessary.

Just a thought,
Izzy

samoore33 wrote:
I found a real nice article on how to copy a directory on MSDN. The
only problem is that I can not figure out how to get the namespace
Microsoft.Visua lBasic.MyServic es. I wanted to know if anyone else has
had experience with this, or knows of a different way to copy a
directory using VB.

I found ways to copy files, but not having a lot of luck with finding a
way to copy a directory other then this information I am finding on
MSDN.

Thanks

Scott Moore
Sep 25 '06 #3
Or use just System.IO.Direc tory... Some of the 2.0 My features are just
wrappers around the .NET framework classes available elsewhere...

--
Patrice

"samoore33" <sa*******@gmai l.coma écrit dans le message de news:
11************* *********@m7g20 00...legro ups.com...
>I found my error, it is for 2.0. I need to upgrade to 2.0 to get it to
work.

samoore33 wrote:
>I found a real nice article on how to copy a directory on MSDN. The
only problem is that I can not figure out how to get the namespace
Microsoft.Visu alBasic.MyServi ces. I wanted to know if anyone else has
had experience with this, or knows of a different way to copy a
directory using VB.

I found ways to copy files, but not having a lot of luck with finding a
way to copy a directory other then this information I am finding on
MSDN.

Thanks

Scott Moore

Sep 25 '06 #4
In the System.IO.Direc tory I can only find Move. I do not see where I
can copy a directory. The Move works, but it cuts the directory, it
does not copy it.

Scott

Patrice wrote:
Or use just System.IO.Direc tory... Some of the 2.0 My features are just
wrappers around the .NET framework classes available elsewhere...

--
Patrice

"samoore33" <sa*******@gmai l.coma écrit dans le message de news:
11************* *********@m7g20 00...legro ups.com...
I found my error, it is for 2.0. I need to upgrade to 2.0 to get it to
work.

samoore33 wrote:
I found a real nice article on how to copy a directory on MSDN. The
only problem is that I can not figure out how to get the namespace
Microsoft.Visua lBasic.MyServic es. I wanted to know if anyone else has
had experience with this, or knows of a different way to copy a
directory using VB.

I found ways to copy files, but not having a lot of luck with finding a
way to copy a directory other then this information I am finding on
MSDN.

Thanks

Scott Moore
Sep 25 '06 #5
I had used a bat file before, but had not thought of calling it through
code. Thanks for the idea.

Scott

Izzy wrote:
Scott,

You may or may not like this method, but I thought I'd post it anyway.

You could use xcopy in a .bat file to copy the directory from one
location to another. Using different switches for xcopy you can include
hidden files, subdirectories, ignore errors, automatically create
subdirectories, turn message prompts off and a bunch of other options.
Here is a complete list of switch options for xcopy:

http://www.computerhope.com/xcopyhlp.htm

You could call this .bat file using
System.Diagnost ics.Process.Sta rt([Path To .bat File])
I think you should be able to hide the command window from showing up.

By starting a new process you would be able to tell when the process
finishes. Additionally you could modify the .bat file in the future so
code changes would not be necessary.

Just a thought,
Izzy

samoore33 wrote:
I found a real nice article on how to copy a directory on MSDN. The
only problem is that I can not figure out how to get the namespace
Microsoft.Visua lBasic.MyServic es. I wanted to know if anyone else has
had experience with this, or knows of a different way to copy a
directory using VB.

I found ways to copy files, but not having a lot of luck with finding a
way to copy a directory other then this information I am finding on
MSDN.

Thanks

Scott Moore
Sep 25 '06 #6
I am trying to use the XCOPY command in a batch file. This is what I am
trying to do.

@echo off

XCOPY C:\Pictures C:\Documents and Settings\smoore \My
Documents\Pictu res

Pause

When I run this I get Invalid number of parameters?

Not sure what I am doing wrong here, please advise.

Scott

Izzy wrote:
Scott,

You may or may not like this method, but I thought I'd post it anyway.

You could use xcopy in a .bat file to copy the directory from one
location to another. Using different switches for xcopy you can include
hidden files, subdirectories, ignore errors, automatically create
subdirectories, turn message prompts off and a bunch of other options.
Here is a complete list of switch options for xcopy:

http://www.computerhope.com/xcopyhlp.htm

You could call this .bat file using
System.Diagnost ics.Process.Sta rt([Path To .bat File])
I think you should be able to hide the command window from showing up.

By starting a new process you would be able to tell when the process
finishes. Additionally you could modify the .bat file in the future so
code changes would not be necessary.

Just a thought,
Izzy

samoore33 wrote:
I found a real nice article on how to copy a directory on MSDN. The
only problem is that I can not figure out how to get the namespace
Microsoft.Visua lBasic.MyServic es. I wanted to know if anyone else has
had experience with this, or knows of a different way to copy a
directory using VB.

I found ways to copy files, but not having a lot of luck with finding a
way to copy a directory other then this information I am finding on
MSDN.

Thanks

Scott Moore
Sep 25 '06 #7
Try this:

XCOPY C:\Pictures "C:\Documen ts and Settings\smoore \My
Documents\Pictu res" /e /c /i /h /k

This issus is you didn't enclose the path with spaces in quatation
marks. Look at the link I sent too see what the switches mean.

Izzy
samoore33 wrote:
I am trying to use the XCOPY command in a batch file. This is what I am
trying to do.

@echo off

XCOPY C:\Pictures C:\Documents and Settings\smoore \My
Documents\Pictu res

Pause

When I run this I get Invalid number of parameters?

Not sure what I am doing wrong here, please advise.

Scott

Izzy wrote:
Scott,

You may or may not like this method, but I thought I'd post it anyway.

You could use xcopy in a .bat file to copy the directory from one
location to another. Using different switches for xcopy you can include
hidden files, subdirectories, ignore errors, automatically create
subdirectories, turn message prompts off and a bunch of other options.
Here is a complete list of switch options for xcopy:

http://www.computerhope.com/xcopyhlp.htm

You could call this .bat file using
System.Diagnost ics.Process.Sta rt([Path To .bat File])
I think you should be able to hide the command window from showing up.

By starting a new process you would be able to tell when the process
finishes. Additionally you could modify the .bat file in the future so
code changes would not be necessary.

Just a thought,
Izzy

samoore33 wrote:
I found a real nice article on how to copy a directory on MSDN. The
only problem is that I can not figure out how to get the namespace
Microsoft.Visua lBasic.MyServic es. I wanted to know if anyone else has
had experience with this, or knows of a different way to copy a
directory using VB.
>
I found ways to copy files, but not having a lot of luck with finding a
way to copy a directory other then this information I am finding on
MSDN.
>
Thanks
>
Scott Moore
Sep 25 '06 #8
Thanks a lot Izzy, it is working now.

Izzy wrote:
Try this:

XCOPY C:\Pictures "C:\Documen ts and Settings\smoore \My
Documents\Pictu res" /e /c /i /h /k

This issus is you didn't enclose the path with spaces in quatation
marks. Look at the link I sent too see what the switches mean.

Izzy
samoore33 wrote:
I am trying to use the XCOPY command in a batch file. This is what I am
trying to do.

@echo off

XCOPY C:\Pictures C:\Documents and Settings\smoore \My
Documents\Pictu res

Pause

When I run this I get Invalid number of parameters?

Not sure what I am doing wrong here, please advise.

Scott

Izzy wrote:
Scott,
>
You may or may not like this method, but I thought I'd post it anyway.
>
You could use xcopy in a .bat file to copy the directory from one
location to another. Using different switches for xcopy you can include
hidden files, subdirectories, ignore errors, automatically create
subdirectories, turn message prompts off and a bunch of other options.
Here is a complete list of switch options for xcopy:
>
http://www.computerhope.com/xcopyhlp.htm
>
You could call this .bat file using
System.Diagnost ics.Process.Sta rt([Path To .bat File])
I think you should be able to hide the command window from showing up.
>
By starting a new process you would be able to tell when the process
finishes. Additionally you could modify the .bat file in the future so
code changes would not be necessary.
>
Just a thought,
Izzy
>
samoore33 wrote:
I found a real nice article on how to copy a directory on MSDN. The
only problem is that I can not figure out how to get the namespace
Microsoft.Visua lBasic.MyServic es. I wanted to know if anyone else has
had experience with this, or knows of a different way to copy a
directory using VB.

I found ways to copy files, but not having a lot of luck with finding a
way to copy a directory other then this information I am finding on
MSDN.

Thanks

Scott Moore
Sep 25 '06 #9

Try This:

XCOPY C:\Pictures "C:\Documen ts and Settings\smoore \My Documents
\Pictures"
"samoore33" <sa*******@gmai l.comwrote in
news:11******** *************@k 70g2000cwa.goog legroups.com:
I am trying to use the XCOPY command in a batch file. This is what I
am trying to do.

@echo off

XCOPY C:\Pictures C:\Documents and Settings\smoore \My
Documents\Pictu res

Pause

When I run this I get Invalid number of parameters?

Not sure what I am doing wrong here, please advise.

Scott

Izzy wrote:
>Scott,

You may or may not like this method, but I thought I'd post it
anyway.

You could use xcopy in a .bat file to copy the directory from one
location to another. Using different switches for xcopy you can
include hidden files, subdirectories, ignore errors, automatically
create subdirectories, turn message prompts off and a bunch of other
options. Here is a complete list of switch options for xcopy:

http://www.computerhope.com/xcopyhlp.htm

You could call this .bat file using
System.Diagnos tics.Process.St art([Path To .bat File])
I think you should be able to hide the command window from showing
up.

By starting a new process you would be able to tell when the process
finishes. Additionally you could modify the .bat file in the future
so code changes would not be necessary.

Just a thought,
Izzy

samoore33 wrote:
I found a real nice article on how to copy a directory on MSDN. The
only problem is that I can not figure out how to get the namespace
Microsoft.Visua lBasic.MyServic es. I wanted to know if anyone else
has had experience with this, or knows of a different way to copy a
directory using VB.

I found ways to copy files, but not having a lot of luck with
finding a way to copy a directory other then this information I am
finding on MSDN.

Thanks

Scott Moore
Sep 25 '06 #10

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

Similar topics

1
3358
by: Antonio Lopez Arredondo | last post by:
hi all !!! I need to copy a folder and its subfolders to another location; which class should I use ? could only find the System.IO.Directory.MOVE but don't know how to COPY. thanks in advance, ant
0
2597
by: Tess | last post by:
Hi, Long time reader, first time poster... Any help is appreciated. I have a few questions regarding Winform controls embedded within an html page. For more info please see the appendix. Now, for the questions. 1. A button on my control executes the System.IO.Directory.GetDirectories funtion (the scanned directory resides on the hosting web server). What credentials is this
4
2145
by: John Blair | last post by:
Hi, Can anyone tell me how to make the Copy Project option work from within Vb.net - it fails on my PC with an error saying the new copy directory is marked as executable and i am not allowed to copy files into that directory on my PC! thanks.
6
1639
by: Wayne Wengert | last post by:
I am using VSNET 2003 to build an ASP.NET/VB set of pages. There are currently about a dozen aspx pages. When I make even a minor change to one page I currently rebuild the solution, copy the project files to a copy directory on my local wwwroot and then FTP all those files and directories to my ISP account to be able to see the change on my web site. This is a lot of data to FTP every time (the bin directory alone is close to 4MB) Is...
4
8119
by: eholz1 | last post by:
Hello PHP group, I am trying to use the copy function to copy files from one directory to another. This does not seem to work for me. What am I missing? Below is the code I am using. <?php $filecount = 0;
1
4152
by: dkmarni | last post by:
Hi, I am trying to do this perl script, but not able to complete it successfully. Here is the description what the script has to do.. Accept two and only two command line arguments. Again, these will be the names of two directories. This time, make sure that the "sending" directory exists (and is, indeed, a directory). Make sure that the "receiving" directory exists, and if not, create it. Then, copy files from the sending directory to...
1
1886
by: ajc308 | last post by:
I'm attempting to sort the <file>s within each <directory> in my XML according to their file extension, then write out the resulting sorted data back to XML format. I had it working before, and when I opened up the file the next day, the XSL behaved completely different. I don't know if I accidentally changed something, but I can't see any problems with my code. My Sample XML: <root name="PlanRepository"> <directory name="connoraj">...
4
2075
by: Masta | last post by:
Hello Group. I have a directory with 3000 ".jpg" named like this: 1234_01.jpg 1234_09.jpg 1234_11.jpg 1234_12.jpg 2341_01.jpg 2341_05.jpg
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
8832
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
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...
1
6798
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
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();...
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.