I'm facing some sort of strange behaviour using xcopy to move files in our network (client machines are windows 7, server is windows 2008 R2).
On an Access application I have an option to load files from client machines to a server drive. This drive has a folder where documents are stored where Access App's users have permissions, however, they haven't on the ancestors folders.
I use xcopy to move files within the Access app and it works perfectly from my windows user (as I have full access to all the path) but from client computers with other users xcopy returns an invalid drive error.
xcopy "c:/myDirectoryWhatever/coolFile.pdf" "\\networkDrive\networkShare\saveToThisFolder\" /R /Y
Works from users with permissions on the full path but not on users with permissions only on saveToThisFolder.
However, if I use:
xcopy "c:/myDirectoryWhatever/coolFile.pdf" "z:\saveToThisFolder\" /R /Y
being Z a network drive built on logon on client machines it works ok.
Why don't change it on Access code? Easy... if I hardcode that drive letter we can find on the future that a change on logon scripts will blindly screw this code. Also a network drive could fail to load on logon due to network connection issues although later that issues solve, on that cases the share would be accesible but the network drive not.
Obviously give permissions on the ancestors of saveToThisFolder is not an option, as it has more folder inside where users shouldn't have access.
With all this in mind I wonder if there's some way to fix the copy of the files without having to use the network drives.