I'm testing a solution for a user getting access denied when running a scheduled backup batch script or by double-clicking it.
I've noticed I have the same issue for a simple xcopy call. Specifically, if I run the xcopy string or call the batch file containing the script from cmd, it works and the file is copied, but if I double-click the file the terminal window shows up for a while and then closes, and the file is not copied. I've tried several solutions like adding a "C:" or "Cd" line, entering the full path to xcopy.exe and adding a call to cmd.exe with the /C parameter at the beginning of xcopy line. Any possible combination of these solutions brought no changes.
Edit: by adding a pause as suggested by @MicroservicesOnDDD I notice I'm getting "access denied". Now I've tried creating another bat with "runas /noprofile /user:\ ". It asks me for password and runs the other bat from which I'm still getting an access denied. I'm using a domain user set as administrator for this computer and I'm doing all this on my default desktop. (C:\Users\\Desktop)
xcopy
.