Thanks a lot Izzy, it is working now.
Izzy wrote:
Try this:
XCOPY C:\Pictures "C:\Documents and Settings\smoore\My
Documents\Pictures" /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\Pictures
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.Diagnostics.Process.Start([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.VisualBasic.MyServices. 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