Hi,
I am trying this script:
And I am getting an error: Access is denied.
If I run that copy script from command line on the same server it runs just fine.
The '\\server' is actually a NAS storage device on our network. It is logged into our domain and the domain\administrator has full rights to the share.
The SQL service and agent are both set to run under the domain administrator account.
If I try this....
Then the copy runs just fine. My script will copy a ton of files from a bunch of different network shares. I would like to automate this so I can't really create drive letters for each copy process... Well, I guess I could figure it out but it would be a big pain.
Anyone have an idea why the copy will work fine if I map the drive first? Any ideas how I can get around this?
I am trying this script:
Code:
exec master..xp_cmdshell 'copy \\server\images15\archive\bentonwa2\BENWA2000547\36652\D3665296.* \\server3\transfer3\dsi\Bentonwa\Replace\2013000113.*'
And I am getting an error: Access is denied.
If I run that copy script from command line on the same server it runs just fine.
The '\\server' is actually a NAS storage device on our network. It is logged into our domain and the domain\administrator has full rights to the share.
The SQL service and agent are both set to run under the domain administrator account.
If I try this....
Code:
exec master..xp_cmdshell 'net use t: \\server\images15 password /user:username /persistent:yes'
exec master..xp_cmdshell 'copy \\server\images15\archive\bentonwa2\BENWA2000547\36652\D3665296.* \\server3\transfer3\dsi\Bentonwa\Replace\2013000113.*'
exec master..xp_cmdshell 'net use t: /delete'
Then the copy runs just fine. My script will copy a ton of files from a bunch of different network shares. I would like to automate this so I can't really create drive letters for each copy process... Well, I guess I could figure it out but it would be a big pain.
Anyone have an idea why the copy will work fine if I map the drive first? Any ideas how I can get around this?