It's possible that the issue is related to the way the batch file is being run. When you run the command manually in a CMD window, it may be running with different permissions or settings than when it's run from the batch file.
You can try adding the command "pause" at the end of your batch file, which will allow you to see any error messages that may be generated during the xCopy process. Additionally, you can try running the batch file as an administrator to see if that resolves the issue.
Another potential issue is that the paths in your xCopy command may not be correct. Make sure that the source and destination paths are valid and that there are no typos or other errors in the command. You can also try using the full paths for both the source and destination, rather than using variables like %USERPROFILE%.
Finally, it's worth checking if there are any antivirus or security software running on the computer that may be interfering with the xCopy process. These programs may be blocking the batch file from accessing certain files or folders. If you suspect this is the case, try disabling the antivirus software temporarily and see if that resolves the issue.
Majan Wala