As mentioned in the comments, rather than using
C:\Users\%username%\AppData\Roaming
, use
%APPDATA%
. If the user's profile has been redirected, or the system drive is not drive
C:
, then your script will currently be copying to the wrong path.
You might want to try
robocopy
instead of
xcopy
:
robocopy | Microsoft Docs[
^]