Solved

Batch File Error Invalid Number of Parameters

Posted on 2008-06-18
4
990 Views
Last Modified: 2008-06-18
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

0
Comment
Question by:Priscilla_Hora
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
rynox earned 500 total points
ID: 21819357
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
 

Author Comment

by:Priscilla_Hora
ID: 21819438
Ahh that was right! so simple! Thanks
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 21819475
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
 
LVL 43

Expert Comment

by:Steve Knight
ID: 21819477
Sorry had typed earlier and hadn;t hit submit...
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
how to print and extire folder structure 6 42
Backup solution 14 71
Convert JPG to PDF file 4 76
Rename files on Windows 10 39
The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now