Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Batch File Error Invalid Number of Parameters

Posted on 2008-06-18
4
Medium Priority
?
1,005 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
rynox earned 2000 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

647 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