# Why is xcopy returning “invalid number of parameters”?

Under some circumstances, xcopy will return the error Invalid number of parameters without giving you a clue as to what’s going on. The usual solution for this is to be sure that your filenames are enclosed in quotes, as this can be an issue with batch files where you have something like xcopy %1 %2 and you really need xcopy "%1" "%2". I recently ran into a problem, however, where the problem wasn't spaces:

C:\Temp\foo>c:/windows/system32/xcopy.exe /f /r /i /d /y * ..\bar\
Invalid number of parameters

-

## migrated from stackoverflow.comFeb 27 '10 at 9:44

This question came from our site for professional and enthusiast programmers.

C:\Temp\foo>c:\windows\system32\xcopy.exe /f /r /i /d /y * ..\bar\

You can also run into this if you have your PATH defined using forward slashes instead of backslashes.