Solved

Batch File Error Invalid Number of Parameters

Posted on 2008-06-18
4
996 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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Script to 9 69
Batch FIle delete files with particular date 10 90
DOS Batch file - Check for existence of a drive letter or directory 4 66
Robocopy command line 6 57
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…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

810 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