Batch File Error Invalid Number of Parameters

I have the following batch file which freaks out with a "Invalid number of parameters" message.
What can I do to fix it?
rd /q /s "C:\Program Files\Common Files\Microsoft Shared\Clipart\Company"
md "C:\Program Files\Common Files\Microsoft Shared\Clipart\Company"
G:
cd msoffice\New_Templates\Company
XCOPY *.* /s /e /c /y C:\Program Files\Common Files\Microsoft Shared\Clipart\Company

Open in new window

Priscilla_HoraAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
rynoxConnect With a Mentor Commented:
First thing i see right off is that you need to throw some quotes around the directory in line 5 as you did in lines one and two.
0
 
Priscilla_HoraAuthor Commented:
Ahh that was right! so simple! Thanks
0
 
Steve KnightIT ConsultancyCommented:
Agreed with above.  Also line 4 could be ambiguous depending upon what the current path is on the G: drive at that point.  Suggest this:

rd /q /s "C:\Program Files\Common Files\Microsoft Shared\Clipart\Company"
md "C:\Program Files\Common Files\Microsoft Shared\Clipart\Company"
XCOPY "G:\msoffice\New_Templates\Company\*.*" /s /e /c /y "C:\Program Files\Common Files\Microsoft Shared\Clipart\Company"

Steve
0
 
Steve KnightIT ConsultancyCommented:
Sorry had typed earlier and hadn;t hit submit...
0
All Courses

From novice to tech pro — start learning today.