10
2
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
Also if you're using this as a
Post-build event, you have to make sure that you put quotes around the full path of$(TargetDir), as there might be spaces in the path:xcopy "$(TargetDir)*.dll" ..\..\Project.Web\bin– Highmastdon – 2015-01-08T12:17:41.3971This can also happen if you have forward slashes in Source or Destination Path. Just replace all forward slashes with backslashes in all the path that you pass to xcopy! – Juraj Petrik – 2015-11-18T15:06:34.573