DOS Batch Error "Invalid Number of Parameters"

Hello,

In the attached code snippet, I'm attempting to copy a some files and directories down a directory path. I get an "Invalid Number of Parameters" error, and I think it's because there are spaces between some of the words in the directory names.  What do I do about this?


c:
cd\
cd documents and settings
cd KEAEmich1
cd Favorites
xcopy *.* /s /y /d g:\KEAEmich\Documents and Settings\KEAEmich1\Favorites
cd\

Open in new window

LVL 1
NigelRocksAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
FC01Connect With a Mentor Commented:
you need to put quotes around the destination like this

"g:\KEAEmich\Documents and Settings\KEAEmich1\Favorites"

0
 
MoorelockConnect With a Mentor Commented:
Try it with quotes:

xcopy *.* /s /y /d g:\KEAEmich\"Documents and Settings"\KEAEmich1\Favorites

or

xcopy *.* /s /y /d "g:\KEAEmich\Documents and Settings\KEAEmich1\Favorites"

I think the first one should do it though.
0
All Courses

From novice to tech pro — start learning today.