Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to write a batch file that will copy all new files from a source to a destination without prompting (it will be running on a server). This script will not copy files that already exist in the destination.

To do this I've set a source, destination and the /Y flag to ignore any prompting about copying files that already exist.

My command is:

xcopy \\source \\destination /Y

However I'm receiving the error:

"Invalid Number of Parameters"

and don't understand why.

share|improve this question
does \\source contains files, directories or both? – Sathya Oct 5 '12 at 4:23
Nope, I had spaces in my source/destination and forgot to encapsulate them in quotes! – Codingo Oct 5 '12 at 4:31
and that's why we say post the exact command. – Sathya Oct 5 '12 at 4:58
It's for work - so always anonymised. Most likely not covered by a non-confidentiality but there is one in place so it always pays to be cautious when internal auditors love to pounce on any and everything. – Codingo Oct 5 '12 at 5:04
up vote 3 down vote accepted

Without seeing the exact command you're entering, all I can tell you is that the most common reason for this is that one or both of the paths you're specifying includes spaces. Try enclosing the source and destination paths in double quotes ("path").

share|improve this answer
This was it.. Thanks! – Codingo Oct 5 '12 at 4:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .