-1

When I'm using Xcopy command in CMD to copy and replace a file from the user's download location to another location, I'm getting invalid number of parameters.

Here's my code:

xcopy /y C:\%userprofile%\downloads\XXXXt\XXXX C:\Program Files (x86)\XXX\XXX\common\XXXX\XXXX\Managed\XXXX

The XXX's represent game files for which we are replacing to mod the game.

Compo
  • 36,585
  • 5
  • 27
  • 39
Ryan Ellis
  • 11
  • 4

1 Answers1

0
  • %USERPROFILE% includes the drive letter. Replace C:\%USERPROFILE% with just %USERPROFILE%.

  • There are space in Program Files (x86), so you need to place the destination in double quotes.

  • Overall, the command should then be xcopy /y "%userprofile%\Downloads\XXXX\XXXX" "C:\Program Files (x86)\XXX\XXX\common\XXXX\XXXX\Managed\XXXX".

AlexP
  • 4,370
  • 15
  • 15