I am running into a problem when trying to copy a file using xp_cmdshell in SQL 2005 using a network path (works fine using a local path). Assuming some sort of permissions issue but not sure why/how.
I have the script:
EXEC master.dbo.xp_cmdshell 'copy c:\test.txt c:\temp\'
This works fine but when I try to use the network paths (to the same exact folders just using the network paths it does not work with "Access denied" message.
EXEC master.dbo.xp_cmdshell 'copy \\ServerName\C$\test.txt \\ServerName\C$\temp\'
The folders are the exact same:
C:\ = \\ServerName\C$\
c:\temp = \\ServerName\C$\temp\
just not sure why it works using local paths but NOT server paths.