Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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! –  ElvisLikeBear Oct 5 '12 at 4:31
2  
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. –  ElvisLikeBear Oct 5 '12 at 5:04
add comment

1 Answer

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! –  ElvisLikeBear Oct 5 '12 at 4:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.