Here's the situation. We have a file server set up at \fileserver\ that has a folder for every user at \fileserver\users\first.last
I'm running an xcopy command to backup the My Documents folder from their computer to their personal folder. The command I'm running is:
xcopy "C:\Users\%username%\My Documents\*" "\\fileserver\users\%username%\My Documents" /D /E /O /Y /I
I've been silently running this script at login without the users knowing, just so I can get it to work before telling them what it does. After I discovered it wasn't working, I manually ran the batch script that executes the xcopy command on one of their computers and get an access denied error. I then logged into a test account on my own computer and got the same error.
I checked all the permissions for the share and security and they're set to how I want them. I can manually browse to that folder and create new files. I can drag and drop items into the \fileserver\users\first.last location and it works great.
So I try something else to try and find the source of the access denied problem. I ran an xcopy command to copy the My Documents folder to a different location on the same machine and I still got the access denied error!
So xcopy seems to be denied access when it tries to copy the My Documents folder.
Any suggestions on how I can get this working? Anyone know the reason behind the access denied error?